CentOS Yum compiles MySQL 5.6
- 2020-06-19 12:24:01
- OfStack
This article shares the specific code of centos yum installation mysql 5.6 for your reference. The specific content is as follows
1. Check whether other versions of MYSQL data are installed in the system
#yum list installed | grep mysql
#yum -y remove mysql-libs.x86_64
2. Installation and configuration
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
# yum repolist all | grep mysql
Install the MYSQL database
# yum install mysql-community-server -y
Set it as boot (2, 3 and 4 are ALL on on behalf of boot)
# chkconfig --list | grep mysqld
# chkconfig mysqld on
3. Set up remote root
Start the mysql
# service mysqld start
Set the root password
# mysql_secure_installation
Log into your root account
# mysql -uroot -p
Set up remote root users
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY ' The password you set ' WITH GRANT OPTION;
mysql> flush privileges;
4. Set es50EN-8 code
View mysql original code:
mysql> show variables like 'character%';
Set the coding
# vi /etc/my.cnf
As follows:
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
# yum repolist all | grep mysql
0
Restart mysql
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
# yum repolist all | grep mysql
1
Check the code again:
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
# yum repolist all | grep mysql
2
5. Add the environment variable and edit /etc/profile so you can use the mysql command anywhere
export PATH=$PATH:/usr/local/mysql//bin<br>source /etc/profile
mysql 5.7 mysql5. 6 mysql5.6 mysql5