I have here is the use of pure system, newly installed centos7, and choose the minimal installation So basically what environment are not, then this article focused on white
Check that mysql environment already exists
Although my system is clean, but others can not guarantee that, in order to avoid what happened next we check whether mysql has been installed
[root@localhost ~]# rpm -qa | grep mysql
[root@localhost ~]# rpm -qa |grep mariadb
mariadb-libs-5.5.64-1.el7.x86_64
I am here to unload mariadb
[root@localhost ~]# yum remove mariadb-libs-5.5.64-1.el7.x86_64
If you find that you like me like to delete just fine
Ali cloud source switching mirror
Install wget
[root@localhost ~]# yum install wget -y
Ali cloud and then download source yum configuration
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Then generate the cache
[root@localhost ~]# yum makecache
Displaying metadata cache has been established on behalf of the completed
Then we look at yum update
[root@localhost ~]# yum update -y
This may take a little time, be patient
Download the domestic mysql rpm package and install
Address http://mirrors.ustc.edu.cn/mysql-ftp/Downloads
me directly through Download Download
First server package
[root@localhost ~]# wget http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.7/mysql-community-server-5.7.25-1.el7.x86_64.rpm
Then the client package
wget http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.7/mysql-community-client-5.7.25-1.el7.x86_64.rpm
There are common
[root@localhost ~]# wget http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.7/mysql-community-common-5.7.25-1.el7.x86_64.rpm
Finally, there is a lib
[root@localhost ~]# wget http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.7/mysql-community-libs-5.7.25-1.el7.x86_64.rpm
Prior to this we have installed three-dependent environment
net-tools.x86_64, libaio.x86_64, perl.x86_64
We directly use the yum install
yum install -y perl.x86_64
yum install -y libaio.x86_64
yum install -y net-tools.x86_64
Then the order of the installation dependent mysql
[root@localhost ~]# rpm -ivh mysql-community-common-5.7.25-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-libs-5.7.25-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-client-5.7.25-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-server-5.7.25-1.el7.x86_64.rpm
We then restart the mysql service at
[root@localhost ~]# service mysqld.service restart
We view the default password
[root@localhost etc]# grep 'temporary password' /var/log/mysqld.log
2020-02-11T09:49:32.224110Z 1 [Note] A temporary password is generated for root@localhost: E;#ySHlql0!>
My password is E; # ySHlql0>!
[root@localhost mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.7.25
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Successful login, password and then change the next remote connection
Change passwords and open a remote connection
change Password
Here because the new version limits the mysql password complexity, so we need to set up a slightly more complex passwords
mysql> set password=password('这里输入你想改的密码');
Query OK, 0 rows affected, 1 warning (0.00 sec)
Password need to include numbers and special symbols, and uppercase and lowercase letters
, of course it will be closed again after the password restrictions to change your password after you set up, but more demonstration here
Open remote connections
Open the mysql database
mysql> use mysql;
Modify a data connection to support remote
mysql> update user set Host = '%' where Host = 'localhost' and User='root';
Refresh system permissions related tables
mysql> flush privileges;
We navicat measuring about
before make sure the firewall open port 3306
I once had a direct here
About the boot from Kai, in this case mysql is started automatically and does not require extra configuration