Linux CentOS 6.5 uninstall, tar install MySQL tutorial


Uninstall MySQL from the system

1. Check whether MySQL is currently installed in the system

rpm -qa|grep -i mysql

2. Uninstall the current version of MySQL

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

Choose “Y” in the process of unloading

Check again and no information indicates that it has been unloaded

3. Find the residual 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 that you do not change it. If you change it, you need to update the configuration
MKDIR / usr / local / MySQL / data ා create the folder data under the MySQL folder 
Groupadd MySQL ා create a user group named mysql   
Useradd - R - G MySQL MySQL - create user under user group

5. Decompress and transfer MySQL files

# tar -xzvf mysql-5.7.17-linux-glibc2.5-x86_ Sixty-four tar.gz        #Unzip file
# cd mysql-5.7.17-linux-glibc2.5-x86_ 64 ා access
#MV * / usr / local / MySQL / ා moving files

6. Enter 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, and modify the data directory owner to MySQL

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

9. Start mysql

./support-files/mysql.server start

Start successfully

If an error is reported when starting mysql, the MySQL process may already exist. Kill it

10. Change 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 the password is changed, you can log in to MySQL
./bin/mysql -h127.0.0.1 -uroot -proot


The above is the introduction of Linux CentOS 6.5 uninstall, tar install MySQL tutorial, I hope to help you, if you have any questions, please leave me a message, the editor will reply to you in time. Thank you very much for your support to the developeppaer website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Recommended Today

Build HTTP service with C + + Mongoose

Mongoose source code address:… Mongoose user manual:… Mngoose set up HTTP service #include <string> #include “mongoose.h” using namespace std; static const char *s_http_port = “8000”; static void ev_handler(mg_connection *nc, int ev, void *ev_data) { struct http_message *hm = (struct http_message *) ev_data; if (ev == MG_EV_HTTP_REQUEST) { std::string uri; if (hm->uri.p && hm->uri.p[0] == ‘/’) […]