Linux CentOS 6.5 Uninstall, tar and install MySQL tutorial

Linux CentOS 6.5 Uninstall, tar and install MySQL tutorial

Uninstall the system-provided MySQL

1. Check whether MySQL is currently installed on the system

rpm -qa|grep -i mysql 

2. Uninstall the current version of MySQL

yum remove mysql mysql-server mysql-libs mysql-server

When a selection appears during the uninstallation process, just click "y"

Check again and no information means it has been uninstalled

3. Find the remaining files and delete them

find / -name mysql

4. Create mysql user group/user, data directory and its user directory

userdel mysql # delete user groupdel mysql # delete user group name mkdir /usr/local/mysql # the default installation path of mysql, it is recommended not to change, if you change it, you need to update the configuration later mkdir /usr/local/mysql/data # create a folder data under the mysql folder 
groupadd mysql # Create a user group named mysql useradd -r -g mysql mysql # Create a user under the user group

5. Unzip and transfer MySQL files

# tar -xzvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz # Unzip the file # cd mysql-5.7.17-linux-glibc2.5-x86_64 # Enter # mv * /usr/local/mysql/ # Move the 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 the data directory owner to mysql

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

9. Start MySQL

./support-files/mysql.server start

Startup Success

If MySQL reports an error when starting, it may be that there is already a MySQL process, just kill it

10. Change mysql password

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

11. Log in to MySQL

# After changing the password, you can log in to MySQL
./bin/mysql -h127.0.0.1 -uroot -proot

Summarize

The above is the tutorial on how to uninstall and install MySQL in Linux CentOS 6.5. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • CentOS7.x uninstall and install MySQL5.7 operation process and encoding format modification method
  • How to completely uninstall mysql under CentOS
  • Several methods to completely uninstall MySQL under CentOS
  • How to uninstall MySQL 5.7 on CentOS7

<<:  Record the whole process of MySQL master-slave configuration based on Linux

>>:  JavaScript implements Tab bar switching effects

Recommend

Detailed explanation of MySQL transactions and MySQL logs

Transactional Characteristics 1. Atomicity: After...

Several ways to use v-bind binding with Class and Style in Vue

Adding/removing classes to elements is a very com...

mysql-8.0.16 winx64 latest installation tutorial with pictures and text

I just started learning about databases recently....

A brief analysis of React's understanding of state

How to define complex components (class component...

JavaScript jigsaw puzzle game

This article example shares the specific code of ...

Getting Started with Mysql--sql execution process

Table of contents 1. Process 2. Core Architecture...

How does MySQL ensure master-slave consistency?

Table of contents The basic principle of MySQL ma...

MySQL uses events to complete scheduled tasks

Events can specify the execution of SQL code once...

Analysis of the principle of centering elements with CSS

It is a very common requirement to set the horizo...

How to install and modify the initial password of mysql5.7.18 under Centos7.3

This article shares with you the installation of ...

How to implement nested if method in nginx

Nginx does not support nested if statements, nor ...

Web Design Teaching or Learning Program

Section Course content Hours 1 Web Design Overvie...

HTML+css to create a simple progress bar

1. HTML code Copy code The code is as follows: Ex...

Hover zoom effect made with CSS3

Result:Implementation code: html <link href=&#...