小编use*_*056的帖子

用点创建mysql数据库

我想使用以下语法创建数据库

mysql -u<uname> -p<password> -e "create database <name>"
Run Code Online (Sandbox Code Playgroud)

但是每当我尝试在数据库名称中使用点(。)时,都会出现错误。

[root@aee9a1889c3f 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

[root@aee9a1889c3f wpg.master]#

[root@aee9a1889c3f wpg.master]#

[root@aee9a1889c3f wpg.master]# mysql -uroot -proot -e "create database `a.n`"
bash: a.n: …
Run Code Online (Sandbox Code Playgroud)

mysql database shell command

2
推荐指数
1
解决办法
315
查看次数

标签 统计

command ×1

database ×1

mysql ×1

shell ×1