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
The database enables slow query logs Modify the c...
The code looks like this: .process{ border:1px so...
This article hopes to gain some insights through a...
<br />The content is reproduced from the Int...
As shown below: LOCATE(substr,str) Returns the fi...
Environment Preparation 1. Environment Constructi...
Due to work reasons, it is often not possible to ...
This article example shares the specific code of ...
1. Download the software 1. Go to the MySQL offic...
This article example shares the specific code of ...
Pre-installation preparation The main purpose of ...
This article shares the installation and configur...
1. Problem There is a table as shown below, we ne...
background We can use react-color to implement th...
Table of contents Preface Is there any hope after...