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! You may also be interested in:
|
<<: Record the whole process of MySQL master-slave configuration based on Linux
>>: JavaScript implements Tab bar switching effects
Transactional Characteristics 1. Atomicity: After...
1. Why do we need to divide tables and partitions...
Adding/removing classes to elements is a very com...
I just started learning about databases recently....
How to define complex components (class component...
This article example shares the specific code of ...
Table of contents 1. Process 2. Core Architecture...
Table of contents The basic principle of MySQL ma...
Events can specify the execution of SQL code once...
It is a very common requirement to set the horizo...
This article shares with you the installation of ...
Nginx does not support nested if statements, nor ...
Section Course content Hours 1 Web Design Overvie...
1. HTML code Copy code The code is as follows: Ex...
Result:Implementation code: html <link href=...