码迷,mamicode.com
首页 > 数据库 > 详细

MySQL 特殊参数

时间:2018-06-21 20:14:27      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:you   ##   表示   The   warning   play   ade   acl   .com   

###开发规范

开发规范:关键字大写,库名字小写,要有字符集
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 特殊参数

标签:you   ##   表示   The   warning   play   ade   acl   .com   

原文地址:https://www.cnblogs.com/nodchen/p/9210735.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!