1. Install MySQL Server
Add the following file Mysql-community.repo file under the/etc/yum.repos.d/directory, as follows:
1 [mysql56-community] 2 name=mysql 5.6 Community Server 3 baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/ 4 enabled=1 5 gpgcheck=0
Execute the Yum install Mysql-community-server.
Start Services # service mysqld start
2. Set the password
1 [email protected] yl]# mysql-u root2 Welcome to the MySQL Monitor. Commands End With; or \g.3 Your MySQL Connection ID is 34 server version:5.6.26 MySQL Community Server (GPL)5 6 Copyright (c), Oracle and/or its affiliates. All rights reserved.7 8 Oracle is a registered trademark of the Oracle Corporation and/or its9 affiliates. Other names trademarks of their respectiveTen owners. One A Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. - -mysql> set password for ' root ' @ ' localhost ' =password (' password ');3. Remote connection Settings
Assign all permissions for all tables in all databases to the root user at all IP addresses.
Mysql> Grant all privileges on * * to [e-mail protected] '% ' identified by ' password ';
If you are a new user and not root, create a new user first
Mysql>create user ' username ' @ '% ' identified by ' password ';
4.
Close the firewall:
[Email protected] ~]# systemctl stop Firewalld.service #停止firewall
[Email protected] ~]# systemctl disable Firewalld.service #禁止firewall开机启动
The remote connection is now available.
CentOS 7 installation MySQL Server 5.6