mysql:数据库名字的格式——不能用横杠 ‘-’ 吗?
1.记得之前的xp系统是可以的,现在win7的不知道为什么不行;
2.查了一下在线文档:
……有关合法数据库名称的规定列于9.2节,“数据库、表、索引、列和别名”。
……数据库 :目录名允许的任何字符,不包括‘/’、‘\’或者‘。’
----------------
mysql>
create database p-pet;
ERROR 1064 (42000): 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 '-pet'
at line 1
mysql> create database ppet;
Query OK, 1 row affected (0.27 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| ppet |
| test |
+--------------------+
5 rows in set (1.30 sec)
------解决方案--------------------`xxxx-yyy` 要加上`号!