CentOS7 MySQL5.6 conflict summary, centos7mysql5.6

Source: Internet
Author: User

CentOS7 MySQL5.6 conflict summary, centos7mysql5.6

 

[Root @ localhost ypeng] # service mysql status

Redirecting to/bin/systemctl status mysql. service
Unit mysql. service cocould not be found.

The reason for the above installation error is that the system may already be incompatible with other versions of mysql-libs or mysql database files.

You can thoroughly uninstall MySQL and clear the MySQL installation files. The procedure is as follows:

[Root @ localhost ypeng] # rpm-qa | grep-I mysql

MySQL-server-5.6.35-1.el7.x86_64
MySQL-client-5.6.35-1.el7.x86_64

[Root @ localhost mysql] # rpm-e MySQL-server-5.6.35-1.el7.x86_64

[Root @ localhost mysql] # rpm-e MySQL-client-5.6.35-1.el7.x86_64
[Root @ localhost mysql] # rpm-aq | grep-I mysql
[Root @ localhost mysql] # cd/var/lib
[Root @ localhost lib] # ll mysql/

-Rw ----. 1 mysql 50331648 Mar 14 ib_logfile0
-Rw ----. 1 mysql 50331648 Mar 14 ib_logfile1
Drwx -- x. 2 mysql 4096 Mar 14 mysql
Drwx ------. 2 mysql 4096 Mar 14 performance_schema
-Rw-r --. 1 root 111 Mar 14 09:22 RPM_UPGRADE_HISTORY
-Rw-r --. 1 mysql 111 Mar 14 RPM_UPGRADE_MARKER-LAST
Drwxr-xr-x. 2 mysql 6 Mar 14 test

As shown above, delete all files in mysql
[Root @ localhost lib] # rm-rf mysql/
[Root @ localhost lib] # ll mysql/
Ls: cannot access mysql/: No such file or directory

 

[Root @ localhost mysql] # rpm-ivh MySQL-server-5.6.35-1.el7.x86_64.rpm
Warning: MySQL-server-5.6.35-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################### [100%]
Updating/installing...
1: MySQL-server-5.6.35-1.el7 ################################# [100%]

Starting from rpm version 4.1, the software package signature is checked during installation or upgrade. If the Signature verification fails, you will see an error message similar to the above: Note: new Signature only for the file Header: error: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Note: no suitable key is installed to verify the Signature. The message contains the NOKEY: error message: warning: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY is caused by the old version of GPG keys installed in yum. The solution is (invalid after setting ): rpm -- import/etc/pki/rpm-gpg/RPM * this signature verifies the validity and installation of the installation package. I skipped (no verification during installation, plus -- nosignature parameter) Check installation: [root @ localhost mysql] # rpm-ivh MySQL-server-5.6.35-1.el7.x86_64.rpm -- nosignature  [Root @ localhost mysql] # service mysql start
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost. localdomain. pid ).

[Root @ localhost ~] # Ll/var/lib/mysql
Total 110640
-Rw ----. 1 mysql 56 Mar 14 auto. cnf
-Rw ----. 1 mysql 12582912 Mar 14 ibdata1
-Rw ----. 1 mysql 50331648 Mar 14 ib_logfile0
-Rw ----. 1 mysql 50331648 Mar 14 ib_logfile1
-Rw ----. 1 mysql 26560 Mar 14 localhost. localdomain. err
Drwx -- x. 2 mysql 4096 Mar 14 mysql
Drwx ------. 2 mysql 4096 Mar 14 performance_schema
-Rw-r --. 1 root 111 Mar 14 09:28 RPM_UPGRADE_HISTORY
-Rw-r --. 1 mysql 111 Mar 14 RPM_UPGRADE_MARKER-LAST
Drwxr-xr-x. 2 mysql 6 Mar 14 test

View path: redundant mysql-bin.index files, such as auto. cnf and performance_schema do not exist (File incomplete ). (The above is the mysql database directory after the successful installation) because the existing MySQL uninstallation is not clean. Delete and uninstall (the solution is as follows), and then reinstall  Start MySQL server again

[Root @ localhost ypeng] # service mysql start
Starting MySQL... SUCCESS!

 

ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)

Solution steps:
1. When mysql is disabled:

/Etc/init. d/mysql start-skip-grant-tables

2. Connect to mysql directly and enter the mysql command line.

Mysql-u root p

Mysql> UPDATE user SET Password = PASSWORD ('000000') where USER = 'root ';

Mysql> flush privileges;

3. Restart mysql.

/Etc/init. d/mysql restart

Yes

Mysql-u root-p

Enter 123456

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.