Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Yum installation MySQL and cluster configuration

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

MariaDB is installed by default in CentOS7, which is a branch of MySQL, but for the sake of need, MySQL is installed on the system, and MariaDB can be overwritten directly after installation.

1 download and install MySQL's official Yum Repository

Wget-I-c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

Use the above command to download the installation Yum Repository directly, about what 25KB looks like, and then you can install yum directly.

Yum-y install mysql57-community-release-el7-10.noarch.rpm

After that, the MySQL server is installed.

Yum-y install mysql-community-server

This step may take some time, and the previous mariadb will be overwritten after the installation is complete.

At this point, the MySQL installation is complete, followed by some settings for MySQL.

2 MySQL database settings

Start MySQL first

Systemctl start mysqld.service

View the running status of MySQL, as shown in the figure:

MySQL is running normally at this time, but to enter MySQL, you need to find out the password of the root user at this time. You can find the password in the log file by using the following command:

Enter the database with the following command:

Mysql-uroot-p

Enter the initial password, and you can't do anything at this time, because MySQL must change the password by default before you can manipulate the database:

ALTER USER 'root'@'localhost' IDENTIFIED BY' new password'

Here is a problem. When setting a new password, an error will be reported if the setting is too simple:

First of all, you need to set the authentication strength level of the password. Set the global parameter of validate_password_policy to LOW.

Enter the setting statement "set global validate_password_policy=LOW;" to set the value

The current password length is 8, so you don't need to modify it if you don't mind. Generally speaking, set the password to 6 digits and set the global parameter of validate_password_length to 6.

Enter the setting statement "set global validate_password_length=6;" to set the value

Now you can set a simple password for mysql, as long as you meet the length of six digits.

ALTER USER 'root'@'localhost' IDENTIFIED BY'a' 123456'

Note: the minimum length of the default password is 4, consisting of uppercase / lowercase letters + Arabic numerals + special characters.

As long as the length of the password is less than 3, the value will be set to 4 automatically.

Set up remote host login (I am using Navicat)

Solve

Detection

Note: if it is a production environment, you don't mind enabling root remote login (security issues).

However, there is another problem at this time, that is, because Yum Repository is installed, every yum operation will be automatically updated later, and this needs to be uninstalled:

Yum-y remove mysql57-community-release-el7-10.noarch

At this point, the database installation is complete.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report