VMWare linux mysql 5.7.13 installation and configuration tutorial,
This article will share with you the tutorial on installing mysql 5.7.13 in VMWare linux for your reference. The details are as follows:
1. Basic Environment Description
Virtual Machine: VMWare
Operating System: linux
Database Version: mysql 5.7.13 community edition (do not ask why the Enterprise Edition is not installed because the Enterprise Edition requires money)
Background: virtual machines can connect to the Internet
2. Understanding
Check whether mysql is installed on linux.
① Start service mysqld start
Prompt if no installation is available
② Check whether the service exists in chkconfig -- list mysqld on linux
Prompt if no installation is available
3. Create the/tools directory (store the downloaded file to this directory) and go to the/tools directory.
# mkdir /tools# cd /tools
4. Download mysql 5.7.13
#wget http://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz
5. decompress the package
# tar -xzf mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz
6. create directory/data/mysql (installation directory)
# cd /# mkdir data# cd /data# mkdir mysql
7. Create a mysql user, group, and Directory
# groupadd mysql# useradd -r -s /sbin/nologin -g mysql mysql -d /tools/mysql-5.7.13-linux-glibc2.5-x86_64
8. Switch the Directory and grant permissions
#cd/tools/mysql-5.7.13-linux-glibc2.5-x86_64#pwd#chown –R mysql .#chgrp –R mysql .#chown -R mysql /data/mysql
If Step 6-8 is not performed, the following error occurs: bin/mysqld: no such file or directory.
9. set parameters
# bin/mysqld --initialize --user=mysql --basedir=/tools/mysql-5.7.13-linux-glibc2.5-x86_64 --datadir=/data/mysql
Note: Remember the temporary password in the red box and will be used later.
#bin/mysql_ssl_rsa_setup --datadir=/data/mysql
10. modify the configuration file
# cd support-files
# cp my-default.cnf /etc/my.cnf# cp mysql.server /etc/init.d/mysql
# vim /etc/init.d/mysql
Modify the following content:
# vim /etc/my.cnf
Modify the following content:
After modification, you 'd better check it again. Sometimes misspelling may cause many messy errors.
11. Start mysql
Note: Check whether the path used in the my. cnf configuration file exists. If the path does not exist, create it by yourself.
# bin/mysqld_safe --user=mysql &
bin/mysql --user=root –p
-- Enter the temporary password generated in step 1
12. Modify the root password
Mysql> set password = password ('20140901'); -- enter the new password
13. Grant Permissions
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456';mysql> flush privileges;
14. Check Results
mysql> use mysql;mysql> select host,user from user;mysql> exit;
15. Add the system path
# vim /etc/profile
Add:
Export PATH =/usr/local/mysql/bin: $ PATH
# source /etc/profile
16. Configure mysql auto-start
# chmod 755 /etc/init.d/mysql# chkconfig --add mysql# chkconfig --level 345 mysql on
For most of the above configurations, see mysql 5.7.13 installation and configuration method graphic tutorial.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.