Graph tutorial on installing and configuring mysql5.7.18 in centos6.4,
Follow these steps to install mysql5.7.18 in centos6.4.
1. First, check whether mysql has been installed and find the mysql-related software rpm package.
#rpm -qa | grep mysql
2. Delete All mysql-related items
#yum -y remove mysql-libs-5.1.66-2.el6_3.x86_64
3. Install the dependency package
#yum -y install make gcc-c++ cmake bison-devel ncurses-devellibaio libaio-devel
4. Create a mysql user group
#groupadd mysql
5. Create a user mysql under the mysql user group
#useradd mysql -g mysql
6-download mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz from the official network
: Https://dev.mysql.com/downloads/mysql/
7. Put mysql-5.7.19-linux-glibc2.12-x86_64.tar in the/opt folder.
8、decompress the file mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
#tar xzvfmysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
9. Rename the mysql-5.7.19-linux-glibc2.12-x86_64 to mysql and move to/usr/local/mysql
#mv mysql-5.7.19-linux-glibc2.12-x86_64 /usr/local/mysql
Create a data directory under/usr/local/mysql
#mkdir /usr/local/mysql/data
10. Return the local directory.
#cd /usr/local
Change the mysql directory and the following files and sub-directory files to mysql.
#chown -R mysql:mysql mysql/
Grant mysql directory and the following files and subdirectories 755 Permissions
#chmod -R 755 mysql/
11. Compile and install mysql and initialize mysql. Remember the password at the end of the command line.
#/Usr/local/mysql/bin/mysqld -- initialize -- user = mysql -- datadir =/usr/local/mysql/data -- basedir =/usr/local/mysql
12. Start the mysql Service
#/usr/local/mysql/support-files/mysql.server start
13. Make a soft connection and restart the mysql service.
#ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql#service mysql restart
14. Create a soft link and put mysql in the/usr/bin directory.
#ln -s /usr/local/mysql/bin/mysql /usr/bin
15. log on to msyql and enter the password (the password is the password generated during initialization in Step 11)
#mysql -u root -p
16. Change the password to 123456.
msql>alter user 'root'@'localhost' identified by '123456';mysql>use mysql;msyql>update user set user.Host='%' where user.User='root';mysql>flush privileges;mysql>quit
17. edit my. cnf and add the configuration file. The configuration content is
#vi /usr/local/mysql/my.cnf[mysqld]port = 3306sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
18. allow port 3306
#iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT#iptables -L -n#service iptables save
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.