mysql 数据库或表中有中划线,无法选择问题
1.问题描述:mysql 数据库名称或表名称中有中划线,在 使用 use databasesName 报错;
1064 - 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 '-XX.XXX TO 'user_XX'@'%'' at line 1
解决方案: `数据库名称`.`表名称`
2. 使用Navicat创建mysql用户
右键数据库 -> 命令列界面
CREATE USER 'user_XX'@'%' IDENTIFIED BY '123456'; GRANT SELECT ON test-XX.XXX TO 'user_XX'@'%';