Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of uninstalling and installing MySQL in Linux CentOS 6.5

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the example analysis of uninstalling and installing MySQL in Linux CentOS 6.5. it has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

Uninstall the system with MySQL

1. Check to see if the system currently has MySQL installed

Rpm-qa | grep-I mysql

two。 Uninstall the current version of MySQL

Yum remove mysql mysql-server mysql-libs mysql-server

There is a choice during the uninstall process, just "y" is fine.

Check again that no message indicates that it has been uninstalled

3. Find the residual file and delete it

Find /-name mysql

4. Create user groups / users, data directories and their user directories for mysql

Userdel mysql # Delete user groupdel mysql # Delete the default installation path of the user group name mkdir / usr/local/mysql # mysql. It is recommended not to change it. If you need to update the configuration mkdir / usr/local/mysql/data # create a folder under the mysql folder data groupadd mysql # create a user group named mysql useradd-r-g mysql mysql # create users under the user group

5. Extract and transfer the MySQL file

# tar-xzvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz # extract the file # cd mysql-5.7.17-linux-glibc2.5-x86_64 # enter the # mv * / usr/local/mysql/ # mobile file

6. Enter the mysql directory to change permissions

Cd mysql/chown-R mysql:mysql. /

7. Execute the installation script

. / scripts/mysql_install_db-- user=mysql

8. After installation, change the current directory owner to root user, and change the data directory owner to mysql

Chown-R root:root. / chown-R mysql:mysql data

9. Start MySQL

. / support-files/mysql.server start

Started successfully

If MySQL starts to report an error, the MySQL process may already exist. Just kill it.

10. Change the mysql password

# after MySQL starts, execute the following command to change the password:. / bin/mysqladmin-u root-h localhost.localdomain password 'root'

11. Log in to MySQL

# after password change, you can log in to MySQL./bin/mysql-h227.0.0.1-uroot-proot. Thank you for reading this article carefully. I hope the article "sample Analysis of uninstalling and installing MySQL in Linux CentOS 6.5" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report