(16) Installation of CentOS MySQL

Source: Internet
Author: User
Tags mysql in mysql command line firewall

First step: Get MySQL Yum source

Go to MySQL website for RPM package

https://dev.mysql.com/downloads/repo/yum/

Click to download

Right-click the Copy link address https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

Get this this is what the Yum warehouse rpm package is actually a

Step two: Download and install the MySQL source

Download the MySQL source installation package First

[Email protected] ~]# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm 

-bash:wget: Command not found

Let's install the wget first.

Yum-y Install wget

And then execute

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

Install MySQL source

Yum-y Localinstall mysql57-community-release-el7-

Step three: Install MySQL online

Yum-y Install Mysql-community-server

Download more things to wait a bit;

Fourth step: Start the MySQL service

Systemctl Start mysqld

Fifth step: Set boot start

[Email protected] ~~]# systemctl daemon-reload

Sixth step: Modify the root local login password

After the MySQL installation is complete, a temporary default password is generated for root in the/var/log/mysqld.log file.

[Email protected] ~]# VI/var/log/mysqld.log

Here's the temporary password emv.r#mwe3ha

[Email protected] ~]#  mysql-u root-p

Enter Password:

Enter the temporary password to enter the MySQL command line;

' Root '@'localhost'youhongjie@123';

Query OK, 0 rows Affected (0.00 sec)

Change Password to Youhongjie@123 (note mysql5.7 default password policy requires password must be a combination of uppercase and lowercase alphanumeric special letters, at least 8 bits)

Seventh step: set Allow Telnet

MySQL default does not allow Telnet, we need to set up, and firewall open 3306 port;

' Root '@'%'youhongjie@123'
0 1 Warning (0.01
MySQL> exit; Bye

Exit under;

[Email protected] ~]# firewall-cmd--zone= public --add-port=3306/tcp--~]# firewall-cmd--

Open 3306 Ports

Eighth Step: Configure the default encoding to UTF8

Modify the/ETC/MY.CNF configuration file and add the encoding configuration under [Mysqld] as follows:

[Mysqld]

Character_set_server=utf8

init_connect= ' SET NAMES UTF8 '

[Email protected] ~]# VI/ETC/MY.CNF

Edit the restart MySQL service after saving;

[[Email protected] ~

View the following code:

' %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 in Set (0.00 sec)

Nineth Step: Test

We use the SQLyog of this machine to remotely connect the MySQL in the virtual machine

OK so the MySQL installation configuration is complete;

(16) CentOS installation MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.