[英]SQL database with column in the tablename
我的MySQL語句中有一個錯誤(使用shell文件),我似乎無法解決。 試圖把引號等,但沒有運氣。 當我使用phpmyadmin創建它時,它可以工作,但是我想編寫腳本。 一定是小東西...有什么想法嗎?
--- Create mySQL database ---
CREATE DATABASE IF NOT EXISTS _test-123;
CREATE USER 'test-123'@localhost IDENTIFIED BY '***';
GRANT ALL PRIVILEGES ON _test-123.* TO 'test-123'@'localhost';
FLUSH PRIVILEGES;
Enter password:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-123' at line 1
嘗試刪除“-”,然后改為執行此操作-
CREATE DATABASE IF NOT EXISTS _test_123;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.