Get the App
SLTechnology News&Howtos  ›  Servers  › 

CentOS Yum compilation and installation of MySQL 5.6

Shulou Source: shulou.com Published: 2022-06-02 03:58:14 10月14日 Update

This article is an example to share the specific code for centos yum to install mysql 5.6. for your reference, the details are as follows

1. Check whether the system installs other versions of MYSQL data

# yum list installed | grep mysql#yum-y remove mysql-libs.x86_64

two。 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 to boot (2, 3, 4 are all on for boot automatically)

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

3. Set up remote root

Start mysql

# service mysqld start

Set root password

# mysql_secure_installation

Log in to the root account

# mysql-uroot-p

Establish a remote root user

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' you set the password 'WITH GRANT OPTION;mysql > flush privileges

4. Set utf-8 Encoding

View the original mysql code:

Mysql > show variables like 'character%'

Set Encodin

# vi / etc/my.cnf

As follows (make up less):

[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-pmysql > 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 | character_set_results | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | / usr/share/mysql/charsets/ | +-- -+ 8 rows in set (0.00 sec)

5. Add the environment variable and edit / etc/profile so that you can use the mysql command anywhere

Export PATH=$PATH:/usr/local/mysql//bin

Source / etc/profile

Wonderful topic sharing: different versions of mysql installation tutorials mysql5.7 various versions of installation tutorials mysql5.6 installation tutorials

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Tags: Version code tutorial content password data different wonderful topic code representative again original variable command place instance that is database environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MySQL Microsoft Shulou Information Redmi