Get the App
SLTechnology News&Howtos  ›  Database  › 

Uninstall and install steps of MySQL in Centos

Shulou Source: shulou.com Published: 2022-05-31 17:46:01 11月14日 Update

This article mainly explains "the steps of uninstalling and installing MySQL in Centos". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the steps of uninstalling and installing MySQL in Centos.

The partition table function of MySQL has been supported since 5.1. the MySQL of Centos is 5.0. it needs to be installed after uninstalling it.

Here are some records of actions, errors, and solutions:

1. Shut down the current mysql service

/ etc/init.d/mysqld stop

two。 Make sure www.2cto.com is shut down properly

Ps-ef | grep mysql

If it is not closed, kill

3. Query the installation of mysql:

Rpm-qa | grep mysql

Delete the listed ones.

Rpm-e mysql-server.x86_64

If more than one is reported, delete them all with the item-- allmatches

4. Rpm version of mysql5.5

Rpm-ivh mysql-server and client

5. Start a new mysql

/ etc/init.d/mysql start

6. Attempt to access

Mysql-uroot-p

My default does not have a password and can be accessed normally

7. But the previous application can not be used, report to cannot load mysql extension. Please check your php configuration

The reason is that php-mysql was deleted just now, but it should not be deleted.

8. Reinstall php-mysql, my system is centos5.3,php 5.1. The dependent php-mysql also installs the php-mysql for 5.1.yum:

Libmysqlclient.so.15 () (64bit) is needed

Libmysqlclient.so.15 (libmysqlclient_15) (64bit) is needed

Php-common is needed www.2cto.com

Libmysqlclient.so is included in mysql-share, but it is not possible to install version 5. 5 mysql-share directly, because this version has no libmysqlclient.so.15 and is higher than 15. 5.

Need to download from http://dev.mysql.com/downloads/mysql/5.1.html#downloads (MySQL-shared-compat-5.1.62-1.rhel5.i386.rpm)

Then install, but because I support the mysql-share installed 5.5, will report a conflict, that is, the rpm installation can not overwrite the previous, use the item-force to force override.

Rpm-ivh php-common-VERSION php-mysql-VERSION installed successfully, resolved the problem

9. An error occurred while remotely accessing the server's settings for another node, Access denied for user 'root'@'localhost'. For the solution, see:

Http://www.2cto.com/database/201204/128445.html, that is:

The following error occurred when the MySQL node executed the GRANT command to authorize the SPIDER server:

> GRANT ALL ON *. * TO 'spider'@'spiderdb' IDENTIFIED BY' spider'

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

However, I logged in using the root user, and the password of root is also empty. How could this error have occurred?

There is the same error on the Internet, which is the solution of not logging into MySQL. If you forget your password, you can use the following methods:

# / etc/init.d/mysql stop

# mysqld_safe-u mysql-skip-grant-tables-skip-networking &

# mysql-u mysql

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

Mysql > FLUSH PRIVILEGES

Mysql > exit www.2cto.com

# / etc/init.d/mysqld restart

# mysql-uroot-pnewpassword

At this point, I believe you have a deeper understanding of the "uninstall and installation steps of MySQL in Centos". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Error step service content password scheme method server usage node solution learning support query login no practical deeper same successful Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker OPPO Reno NVidia MariaDB