我想創建一個數據庫使用以下語法MySQL數據庫的創建與點
mysql -u<uname> -p<password> -e "create database <name>"
但每當我嘗試使用點(。)在數據庫的名字,它給我的錯誤。
[[email protected] wpg.master]# mysql -uroot -proot -e "create database 'a.n'"
Warning: Using a password on the command line interface can be insecure.
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 ''a.n'' at line 1
[[email protected] wpg.master]#
[[email protected] wpg.master]#
[[email protected] wpg.master]# mysql -uroot -proot -e "create database `a.n`"
bash: a.n: command not found
Warning: Using a password on the command line interface can be insecure.
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 '' at line 1
我知道我能做到這一點使用諸如SQL Pro或使用mysql命令編輯器SQL編輯器,但我想這樣做這種方式。請幫忙。
在此先感謝
的解決方案,我一直在尋找。謝謝 – user6457056
我剛剛編輯我的答案,以顯示如何使用'mysql'而不是'mysqladmin' – Aegis