CentOS Yum compile and install MySQL 5.6

The examples in this article share the specific code for installing mysql 5.6 on centos yum 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
  1. 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 MYSQL database

# yum install mysql-community-server -y

Set to boot up (2, 3, and 4 are all on for automatic startup)

# chkconfig --list | grep mysqld
# chkconfig mysqld on
  1. Set up remote root

Start mysql

# service mysqld start

Set root password

# mysql_secure_installation

Log in to root account

# mysql -uroot -p 

Establish remote root user

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'The password you set' WITH GRANT OPTION;
mysql> flush privileges;
  1. Set utf-8 encoding

View the original encoding of mysql:

mysql> show variables like 'character%';

Set encoding

# vi /etc/my.cnf

As follows (less fill):

[ mysqld]
character-set-server=utf8 
collation-server=utf8_general_ci

[ mysql]default-character-set= utf8

[ mysql.server]default-character-set= utf8

[ mysqld_safe]default-character-set= utf8

[ client]default-character-set= utf8

Restart mysql

# service mysqld restart

Check the code again:

# mysql -uroot -p
mysql> show variables like 'character%';+--------------------------+----------------------------+| Variable_name | Value |+--------------------------+----------------------------+| character_set_client | utf8 || character_set_connection | utf8 || character_set_database | utf8 || character_set_filesystem | binary || character_set_results | utf8 || character_set_server | utf8 || character_set_system | utf8 || character_sets_dir |/usr/share/mysql/charsets/|+--------------------------+----------------------------+8 rows inset(0.00 sec)
  1. Add environment variables, edit /etc/profile, so you can use mysql commands anywhere
export PATH=$PATH:/usr/local/mysql//bin<br>source /etc/profile

Wonderful topic sharing: mysql installation tutorial for different versions of mysql5.7 installation tutorial for each version of mysql5.6 installation tutorial for each version

The above is the whole content of this article, I hope it will be helpful to everyone's study.

Recommended Posts

CentOS Yum compile and install MySQL 5.6
CentOS7 yum install and start mysql
CentOS7 yum install and start mysql
CentOS 7.2 Yum install MySQL 5.6
CentOS7.5 source code compile and install mysql5.7.29
Centos7 compile and install MySQL8 problem record
Compile and install nodejs and yum in Centos8
CentOS7.4 source code compile and install MySQL8.0
centos install mysql through yum
CentOs7.3 compile and install Nginx 1.9.9
Centos compile and install Git
Centos7 compile and install ntp-4.2.8p11
CentOS 6.9 compile and install python
CentOS 6 compile and install python 3
Compile and install LAMP under Centos 5.2
CentOS7.2 install Mysql5.7.13
CentOS7 install MySQL
CentOS 6.x compile and install Nginx
CentOS7 compile and install L(A|N)MP environment
CentOS install mysql
CentOS7 install mysql
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos yum install mysql5.6 or above
Centos compile and install LAMP (apache-2.4.7 + mysql-5.5.35 + php 5.5.8) + Redis
CentOS 7 install MySQL 5.6
CentOS8 install MySQL8.0
CentOS7 install mysql8
CentOS7 install MySQL8
Linux CentOS6 compile and install Pyt
centos 7.5 install mysql5.7.17
Compile and install libmodbus library under CentOS7
CentOS yum install Apache + PHP + Tomcat7 + MySQL
CentOS7 system yum way to install MySQL5.7
Install centos7 and connect
Centos7 YUM install MariaDB 10.0
CentOS6.5 offline install MySQL5.6.26
Install MySQL5.7 in centos7
Install mysql5.7 under CentOS7
Centos7 install Mysql8 tutorial
Centos manually install mysql8
Install mysql under Centos 7
Centos7 install Mysql database
Centos7 YUM install MariaDB 10.0
Install mysql5.1 under CentOS6.5
CentOS8 deploys LNMP environment to compile and install mysql8.0.29 tutorial details
Install svn and configuration through yum under CentOS
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
Centos6.5 compile and install LNMP architecture web environment
Centos7.2 compile and install way to build phpMyAdmin
Install mysql online on centos
centos7 install python3 and ipython
Centos mysql installation and configuration
Know Linux and install CentOS
CentOS 7 install Mono and MonoDevelop
Ubuntu 16.04 compile and install PHP 7.2
ubuntu18.04 compile and install python3.8
CentOS6.5 install Java 8 and Tomcat8
Install MySQL 8.0.16 on Linux Centos
Centos 6.10 reinstall python and yum
Install MySQL under Linux (CentOS 7)
Centos6.5 install and configure mongodb