CentOS7 yum install and start mysql

Installation environment: CentOS7 64-bit MINI version, install MySQL5.7

1、 Configure YUM source

Download the YUM source rpm installation package in the MySQL official website: https://dev.mysql.com/downloads/repo/yum/

# Download the mysql source installation package
shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# Install mysql source
shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm

Check whether the mysql source is installed successfully

shell> yum repolist enabled | grep "mysql.*-community.*"

Seeing the picture above indicates a successful installation.

2、 Install MySQL

shell> yum install mysql-community-server

3、 Start MySQL service

shell> systemctl start mysqld

View the startup status of MySQL

shell> systemctl status mysqld

4、 boot

shell> systemctl enable mysqld
shell> systemctl daemon-reload

5、 Modify root local login password

After mysql is installed, a default password is generated for root in the /var/log/mysqld.log file. Find the default root password in the following way, and then log in to mysql to modify it:

shell> grep 'temporary password' /var/log/mysqld.log

shell> mysql -u root -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!'; 

or

mysql>set password for'root'@'localhost'=password('MyNewPass4!');

Note: mysql5.7 installs the password security check plugin (validate_password) by default. The default password check policy requires that the password must contain uppercase and lowercase letters, numbers and special symbols, and the length cannot be less than 8 characters. Otherwise, it will prompt ERROR 1819 (HY000): Your password does not satisfy the current policy requirements error, as shown in the following figure:

6. Allow remote login###

**By default, MySQL only allows the root account to log in locally. If you want to connect to MySQL remotely, you must enable the root user to allow remote connections, or add an account that allows remote connections. **

mysql -u root -p

Use mysql library: use mysql
Query information: select user,host from user

In the host field, localhost means that only the local machine is allowed to access. To realize remote connection, you can change the host of the root user to %,% means that any host is allowed to access. If you need to set to allow only specific ip access, you should change to the corresponding ip .

Finally, if you connect remotely in Navicat under windows, no error will be reported.

Recommended Posts

CentOS7 yum install and start mysql
CentOS7 yum install and start mysql
CentOS Yum compile and install MySQL 5.6
CentOS 7.2 Yum install MySQL 5.6
centos install mysql through yum
CentOS7.2 install Mysql5.7.13
CentOS7 install MySQL
CentOS install mysql
CentOS7 install mysql
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos yum install mysql5.6 or above
CentOS 7 install MySQL 5.6
CentOS8 install MySQL8.0
CentOS7 install mysql8
CentOS7 install MySQL8
centos 7.5 install mysql5.7.17
CentOS yum install Apache + PHP + Tomcat7 + MySQL
CentOS7.5 source code compile and install mysql5.7.29
Centos7 compile and install MySQL8 problem record
Compile and install nodejs and yum in Centos8
CentOS7.4 source code compile and install MySQL8.0
CentOS7 system yum way to install MySQL5.7
Install centos7 and connect
Centos7 YUM install MariaDB 10.0
Vmware-install and start Centos 8
CentOS6.5 offline install MySQL5.6.26
Install MySQL5.7 in centos7
Install mysql5.7 under CentOS7
Vmware-install and start Centos 7
Centos manually install mysql8
Install mysql under Centos 7
Centos7 install Mysql database
Centos7 YUM install MariaDB 10.0
Install mysql5.1 under CentOS6.5
Install svn and configuration through yum under CentOS
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
Install mysql online on centos
centos7 install python3 and ipython
Centos mysql installation and configuration
Know Linux and install CentOS
CentOs7.3 compile and install Nginx 1.9.9
CentOS6.5 install Java 8 and Tomcat8
Centos compile and install Git
Install MySQL 8.0.16 on Linux Centos
Centos 6.10 reinstall python and yum
Install MySQL under Linux (CentOS 7)
Centos6.5 install and configure mongodb
CentOS7 install python3 and pip3
CentOS7 install OracleJDK and JRE
CentOS6.5 install Java 8 and Tomcat8
Centos6 install mysql 5.7.x series
CentOS6 install and crack Jira 7
CentOS6.5 install Java 8 and Tomcat8
Centos7 compile and install ntp-4.2.8p11
CentOS 6.9 compile and install python
CentOS6 install and crack confluence
CentOS 6 compile and install python 3
CentOS6 install and crack Jira 7
CentOS 7 yum install PHP7.3 tutorial
CentOS8 install MySQL8 (pro test)
Centos compile and install LAMP (apache-2.4.7 + mysql-5.5.35 + php 5.5.8) + Redis