1. 程式人生 > >MySQL 特殊參數

MySQL 特殊參數

type clear clas OS cas dem 也會 init 表示

###開發規範

開發規範:關鍵字大寫,庫名字小寫,要有字符集
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###

MySQL 特殊參數