标签:
1、将mysql程序包解压到/usr/local/mysql
tar -xvf mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
2、创建mysql用户
[root@web ~]#groupadd -r mysql
[root@web ~]# useradd -g mysql -r -s /sbin/nologin -M -d /usr/local/mysql mysql
[root@web ~]# chown -R mysql:mysql /usr/local/mysql
3、初始化mysql
scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/mysqldata
ls /usr/local/mysql/mysqldata/ #查看 data 目录有文件说明初始化成功
4、设置启动服务
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
chkconfig mysqld --list
5、设置允许远程登录mysql
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
6、查看数据库表数量
SELECT count(TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_SCHEMA=‘sgerpexam‘
7、mysql设置区分大小写
vi /usr/local/mysql/my.cnf
lower_case_table_names = 1 #0区分大小写 1不区分大小写
标签:
原文地址:http://www.cnblogs.com/czrwxw/p/4284349.html