Linux CentOS6.5 yum install mysql 5.6

1. For a newly opened cloud server, you need to check whether the system comes with mysql installed

# yum list installed | grep mysql

2. If you find that there is a system with mysql, do it decisively

# yum -y remove mysql-libs.x86_64

3. Just execute it in the directory where you store the file. Let me explain here. Since the yum source server of mysql is abroad, the download speed will be slower. Fortunately, mysql5.6 is only 79M large, while mysql5.7 has 182M. , so this is the reason why I don't want to install mysql5.7

# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

4. Then execute this sentence, explain that this rpm is not a mysql installation file, but two yum source files. After execution, there will be more mysql-community-source in the /etc/yum.repos.d/ directory. repo and mysql-community.repo

# rpm -ivh mysql-community-release-el6-5.noarch.rpm 

5. At this time, you can use the yum repolist mysql command to check whether there is already a mysql installable file

#yum repolist all | grep mysql

6. Install the mysql server command (all the way yes):

# yum install mysql-community-server

7. After successful installation

# service mysqld start

8. When mysql is just installed, the password of the root user of mysql is empty by default, so we need to log in with the root user of mysql in time (enter for the first time, no need to enter the password), and change the password

# mysql -u root
# use mysql;
# update user set password=PASSWORD("这里输入root用户密码") where User='root'; # flush privileges; 

9. Check whether mysql is self-starting, and set the command to enable self-starting

 
# chkconfig --list | grep mysqld
# chkconfig mysqld on

10.mysql security settings (the system will ask you a few questions along the way, if you can't understand the translation after copying, basically all the way yes):

# mysql_secure_installation

Reprinted from: https://www.cnblogs.com/renjidong/p/7047396.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325126659&siteId=291194637