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
# yum list installed | grep mysql
# yum -y remove mysql-libs.x86_64
# 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
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;
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)
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