1.mysql5.7.17 installed in the/usr/local/mysql directory, can also be installed in other places (the installation package is best with the Linux system, eg;64 bit is "mysql-5.7.17-linux-glibc2.5-x86_64." Tar.gz ", available on the website for download)
Mkdir/usr/local/mysql
2. Unzip and copy
- TAR-XVF mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
- MV mysql-5.7.17-linux-glibc2.5-x86_64/*/usr/local/mysql/
3. Create the Data directory (very important!) )
Mkdir/usr/local/mysql/data
4. Re-create MySQL users and user groups
Command: Groupadd MySQL #添加用户组
Useradd-r-s/sbin/nologin-g MySQL mysql-d/usr/local/mysql #新建msyql用户禁止登录shell
5. Change MySQL directory permissions
Chown-r mysql.mysql/usr/local/mysql/
6. Next Initialize the database:
Command:./bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/ data/
7. Copy the configuration file to/etc/my.cnf
- Cp-a./SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF (select y)
8. After switching to the MySQL directory, copy the service file to the startup directory
cp support-files/mysql.server /etc/init.d/mysql.server
Set environment variable/etc/profile
export PATH=$PATH:/usr/local/mysql/bin
启动停止
Service Mysql.server start;
Service Mysql.server stop; start
- 9 Start
- 10. Change root password
View initial Password
Command: Cat/root/.mysql_secret
Command: Bin/mysql-uroot-p
Password is just copy of the password, paste in the return.
11. Following the above installation is not possible to remote access, you need to modify the Allow remote connection, the steps are as follows:
The way that MySQL does not differentiate between table name capitalization is actually simple:
1. Log in with root, modify/ETC/MY.CNF
2. Add a line under [mysqld]: Lower_case_table_names=1
3. Restart the database to
Install mysql5.7.17 and simple configuration under Linux