CentOS installation configuration -MYSQL

Introduction of MYSQL
  • The characteristics of

MySQL is a relational database management system developed by MySQL AB and currently owned by Oracle. MySQL is a relational database management system. Relational databases keep data in different tables instead of putting all data in one large warehouse, which increases speed and flexibility.

  • advantage

MySQL is open source and is currently owned by Oracle.

MySQL supports large databases. Can handle large databases with tens of millions of records. MySQL uses the standard SQL data language format. MySQL runs on multiple systems and supports multiple languages. These languages include C, C++, Python, Java, Perl, PHP, Eiffel, Ruby, and Tcl. MySQL has good support for PHP, the most popular Web development language. MySQL supports large databases and data warehouses with 50 million records. The maximum size of 32-bit system table files is 4GB, and the maximum size of 64-bit system table files is 8TB. MySQL is customizable. Under the GPL, you can modify the source code to develop your own MySQL system.

Install MYSQL(usr/local/ MYSQL)
  • Use wget to download the MYSQL5.7 software source

Wget dev.mysql.com/get/mysql57…

  • Install the MYSQL RPM package

yum -y localinstall mysql57-community-release-el7-11.noarch.rpm

  • Install the MYSQL server

yum install -y mysql-community-server

Common commands
Run the following command to start the mysql service: systemctl start mysqld Run the following command to stop the mysql service: systemctl stop mysqld Run the following command to check the mysql status: systemctl status mysqld 1.systemctlenable mysqld 
2.systemctl daemon-reload
Copy the code
Changing the Default Password

View the current mysql default password: cat/var/log/mysqld log | grep ‘A temporary password’1. Mysql -u root -p

2. Enter the password and press Enter

If your password is too simple, an error message will be displayed as follows: Your password is too simple and does not comply with the rules. The default rule is to use uppercase and lowercase letters, digits, and special characters, and the length should be greater than 8 characters

Set global validate_password_length=6; set global validate_password_length=6; The default password must contain more than 8 characters. Change the password level to 6 characters by using the preceding secret command: set global VALIDate_password_policy =0. Set password for ‘root’@’localhost’=password(‘123456’);

Configuring remote Connections
use mysql; Select mysql database
update user set host=The '%' where user ='root'; Allow remote machine connections
flush privileges; # refresh permission
Copy the code

If the connection is still not possible because of the firewall, details can see the following article, at the end of the configuration method: this is the CentOS installation configuration -Redis, at the end of the configuration firewall method

If you have any questions, please reply regularly