Install mysql and linuxmysql in Linux
1. decompress 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
[Root @ web ~] # Groupadd-r mysql
[Root @ web ~] # Useradd-g mysql-r-s/sbin/nologin-M-d/usr/local/mysql
[Root @ web ~] # 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/# Check that a file in the data directory indicates that the initialization is successful.
4. Set the startup Service
Cp support-files/mysql. server/etc/init. d/mysqld
Chkconfig -- add mysqld
Chkconfig mysqld on
Chkconfig mysqld -- list
5. set to allow remote logon to mysql
Grant all privileges on *. * TO 'root' @ '%' identified by '000000' 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 case sensitive 1 case insensitive