1. Unzip the MySQL package to/usr/local/mysql
TAR-XVF mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
2. Create a MySQL user
[[Email protected] ~] #groupadd-R MySQL
[Email protected] ~]# useradd-g mysql-r-s/sbin/nologin-m-d/usr/local/mysql MySQL
[Email protected] ~]# chown-r mysql:mysql/usr/local/mysql
3. Initialize MySQL
scripts/mysql_install_db--user=mysql--datadir=/usr/local/mysql/mysqldata
ls/usr/local/mysql/mysqldata/#查看 Data Directory with file description successful initialization
4. Set up the start-up service
CP Support-files/mysql.server/etc/init.d/mysqld
Chkconfig--add mysqld
Chkconfig mysqld on
Chkconfig mysqld--list
5, set allow remote login MySQL
GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;
FLUSH privileges;
6. View the number of database tables
SELECT COUNT (table_name) from INFORMATION_SCHEMA. TABLES WHERE table_schema= ' Sgerpexam '
7. mysql settings are case-sensitive
Vi/usr/local/mysql/my.cnf
Lower_case_table_names = 1 #0区分大小写 1 case insensitive
Linux installation MySQL