mysql到底是区别大小写还是不区别呢,这取决于所使用的操作系统,如在windows下:
可以看出,是不区分大小写的,cookbook == COOKBOOK;
在linux下呢:
可以看出,在linux系统下cookbook 是不等于COOKBOOK的。
——————————————————
通常情况下,对于保留字我们用大写字母,其他标识符用小写,从《mysql核心技术》这本书中看到的,决定以后按照这种规范处理关于数据库方面的问题。 :D
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cookbook |
| db |
| mysql |
| test |
+--------------------+
5 rows in set (0.28 sec)
mysql> use COOKBOOK;
Database changed
mysql>
可以看出,是不区分大小写的,cookbook == COOKBOOK;
在linux下呢:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cookbook |
| mysql |
+--------------------+
3 rows in set (0.00 sec)
mysql> use COOKBOOK;
ERROR 1049 (42000): Unknown database 'COOKBOOK'
mysql> use cookbook;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql>
可以看出,在linux系统下cookbook 是不等于COOKBOOK的。
——————————————————
通常情况下,对于保留字我们用大写字母,其他标识符用小写,从《mysql核心技术》这本书中看到的,决定以后按照这种规范处理关于数据库方面的问题。 :D