MySQL 特殊参数
###開發規范
開發規范:關鍵字大寫,庫名字小寫,要有字符集
CREATE DATABSE oldboy CHARSET utf8;? ? ###建議采用第一種
CREATE DATABSE oldboy CHARSET utf8mb4;
?
?
###lower_case_table_names? ?begin###
mysql> show variables like '%lower%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | OFF |
| lower_case_table_names | 0 |
+------------------------+-------+
2 rows in set (0.00 sec)
#lower_case_table_names
如果此參數寫作1的話表示強制小寫,
即使創建的數據庫名字為大寫也會強制修改為小寫
?
測試:修改/etc/my.cnf文件--->>>>>>>>lower_case_table_names 將該參數置為1
?
?后續操作見代碼塊
1 #重啟數據庫 2 [root@db01-sa ~]# /etc/init.d/mysqld restart 3 Shutting down MySQL..... SUCCESS! 4 Starting MySQL.... SUCCESS! 5 #登錄數據庫 6 [root@db01-sa ~]# mysql -uroot -p123 7 Warning: Using a password on the command line interface can be insecure. 8 Welcome to the MySQL monitor. Commands end with ; or \g. 9 Your MySQL connection id is 1 10 Server version: 5.6.38-log Source distribution 11 12 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. 13 14 Oracle is a registered trademark of Oracle Corporation and/or its 15 affiliates. Other names may be trademarks of their respective 16 owners. 17 18 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 19 20 mysql> show databases; 21 +--------------------+ 22 | Database | 23 +--------------------+ 24 | information_schema | 25 | mysql | 26 | performance_schema | 27 | test | 28 +--------------------+ 29 4 rows in set (0.05 sec) 30 31 mysql> CREATE DATABASE OLDBOY CHARSET utf8; 32 Query OK, 1 row affected (0.39 sec) 33 34 mysql> show databases; 35 +--------------------+ 36 | Database | 37 +--------------------+ 38 | information_schema | 39 | mysql | 40 | oldboy | 41 | performance_schema | 42 | test | 43 +--------------------+ 44 5 rows in set (0.00 sec) View Code?
###lower_case_table_names? ?end###
?
轉載于:https://www.cnblogs.com/nodchen/p/9210735.html
總結
以上是生活随笔為你收集整理的MySQL 特殊参数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: shell获取命令结果返回行数(行个数)
- 下一篇: linux下,MySQL默认的数据文档存