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
Table of contents 1. Array flattening (also known...
1. The role of index Generally speaking, an index...
1. Scenario description: My colleague taught me h...
Cooper talked about the user's visual path, w...
We can set a background image for the cell, and w...
Table of contents Preface Quick Review: JavaScrip...
Table of contents Linux 1. Basic use of crontab 2...
Table of contents 1. Effect 2. Main code 1. Effec...
Every visit will generate Cookie in the browser, ...
The previous article introduced how to achieve a ...
Basic Use <!DOCTYPE html> <html lang=&qu...
React originated as an internal project at Facebo...
In this experiment, we configure MySQL standard a...
Table of contents What is VUE Core plugins in Vue...
The element ui table does not have a built-in dra...