In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the method of downloading mysql for centos of linux operation. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
MariaDB is installed by default in CentOS, 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 [root@localhost ~] # 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.
[root@localhost] # yum-y install mysql57-community-release-el7-10.noarch.rpm
After that, the MySQL server is installed.
[root@localhost ~] # 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
[root@localhost ~] # systemctl start mysqld.service
View the running status of MySQL, as shown in the figure:
[root@localhost ~] # systemctl status mysqld.service
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:
[root@localhost ~] # grep "password" / var/log/mysqld.log
Enter the database with the following command:
[root@localhost] # 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:
Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' new password'
It might show up.
Refresh the flush privileges; and reset the password
Here is a problem. When setting a new password, an error will be reported if the setting is too simple:
The reason is that MySQL has a specification for password setting, which is specifically related to the value of validate_password_policy:
The complete initial password rules for MySQL can be viewed with the following command:
Mysql > SHOW VARIABLES LIKE 'validate_password%' +-- +-+ | Variable_name | Value | +-- +-+ | validate_password_check_user_ Name | OFF | | validate_password_dictionary_file | | validate_password_length | 4 | validate_password_mixed_case_count | 1 | validate_password_number_count | 1 | validate_password_policy | LOW | | validate_password_special_char_count | 1 | +- -+-+ 7 rows in set (0.01 sec)
The length of the password is determined by validate_password_length, and the formula for validate_password_length is:
Validate_password_length = validate_password_number_count + validate_password_special_char_count + (2 * validate_password_mixed_case_count)
Mine has been modified, and the first value in the initial case is ON,validate_password_length 8. You can modify it with the following command:
Mysql > set global validate_password_policy=0;mysql > set global validate_password_length=1
After the setting, I found out the above values, at this time the password can be set very simple, such as 1234 and so on. The password setting to this database is complete.
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:
[root@localhost] # yum-y remove mysql57-community-release-el7-10.noarch
It was only then that it was really finished.
On the linux operation of centos download mysql method to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.