Centos6 mounting mysql (yum embodiment)

1. Check the server comes with mysql

yum list installed|grep mysql

2. Remove mysql, so as not to reinstall the conflict

yum remove the name comes mysql

3. Download the mysql yum source

CentOS6 of MySQL: wget https://dev.mysql.com/get/mysql80-community-release-el6-3.noarch.rpm 
MySQL CentOS7 of: wget https://dev.mysql.com/get/mysql80-community -release-el7-3.noarch.rpm

4. rpm installation package, after installation, will get the mysql yum repo two sources: /etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo .

sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm

5. Installation mysql

sudo yum install mysql-server

6. Start mysql server

service mysqld start

7. reset the password: the default root account has no password

mysql -u root
mysql > use mysql;
mysql > update user set password=password('123456') where user='root';
mysql > flush privileges;
mysql > exit;

8. open port 3306

sudo vim / etc / sysconfig / iptables 
add the following:
-A the INPUT -p TCP TCP -m -m State --state --dport 3306 NEW -j ACCEPT
save reboot the firewall:
sudo service iptables restart
 

In this way from other clients can connect on mysql served.

Guess you like

Origin www.cnblogs.com/jvStarBlog/p/12589236.html