1. Upload rz to the server and decompress it rz [root@mini2 upload]# tar -xvf mysql-5.7.19-1.el6.i686.rpm-bundle.tar 2. Install the rpm package rpm -ivh mysql-community-common-5.7.19-1.el6.i686.rpm rpm -ivh mysql-community-libs-5.7.19-1.el6.i686.rpm rpm -ivh mysql-community-libs-compat-5.7.19-1.el6.i686.rpm rpm -ivh mysql-community-client-5.7.19-1.el6.i686.rpm rpm -ivh mysql-community-server-5.7.19-1.el6.i686.rpm Note: If it is not a new installation, but was previously installed using rpm, but was not installed properly and then uninstalled, the following situations may occur: When executing There is a high possibility that the data directory is not cleared. Let's try manually initializing it and execute the following command: [root@mini2 upload]# mysqld --initialize --user=mysql 2017-08-29T05:22:18.750237Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-08-29T05:22:18.754943Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting. 2017-08-29T05:22:18.755064Z 0 [ERROR] Aborting I found an error message, and searched Baidu for it. I found that I needed to clear the data directory: From the official documentation, the data directory location is: Then clear it and try again. [root@mini2 upload]# rm -rf /var/lib/mysql/* Next, initialize: mysqld --initialize --user=mysql Next, start mysql: [root@mini2 upload]# service mysqld start Starting mysqld: [ OK ] 3. Find the initial password (the reason why I have two passwords here is probably because I didn’t uninstall it completely before, so I intuitively think I should use the new password later to log in) [root@mini2 upload]# grep 'temporary password' /var/log/mysqld.log 2017-08-29T05:00:02.613275Z 1 [Note] A temporary password is generated for root@localhost: tzqjMvkHH3+C 2017-08-29T05:31:51.340338Z 1 [Note] A temporary password is generated for root@localhost: Adgwggdr%1e2 4. Login [root@mini2 upload]# mysql -uroot -p I logged in ok, the password is Adgwggdr%1e2 5. Change the password and allow clients on other machines to log in ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option Summarize The above is the solution to the initialization error of mysql5.7 installed with rpm package in centos6.5 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: How to use CocosCreator for sound processing in game development
>>: How to add custom system services to CentOS7 systemd
If you want to understand React Router, you shoul...
<br />I have always believed that Yahoo'...
First is the idea We use the <input type="...
This is what happened. Today I was playing with G...
Scenario 1: Html: <div class="outer"...
1. E-Commerce Icons 2. Icon Sweets 2 3. Mobile Ph...
Preface In MySQL, cross-database queries are main...
My machine environment: Windows 2008 R2 MySQL 5.6...
A record of an online MySQL transaction problem L...
Generally, the colspan attribute of the <td>...
I believe that everyone needs to reinstall MySQL ...
Table of contents Overview 1. Overview of input a...
nginx is our most commonly used server, often use...
iOS 1. URL scheme This solution is basically for ...
1. Download related tools and images Download Lin...