illustrate This article was written on 2017-05-20, using MySQL-5.7.18. The operating system is 64-bit CentOS Linux release 7.2.1511 (Core), installed as a desktop. Uninstall MariaDB CentOS7 installs MariaDB instead of MySQL by default, and the MySQL-related packages are also removed from the yum server. Because MariaDB and MySQL may conflict, uninstall MariaDB first. 1. Check the installed MariaDB related rpm packages. rpm -qa | grep mariadb 2. Check the installed MariaDB-related yum packages. The package name needs to be determined according to the result of the rpm command. yum list mariadb-libs 3. Remove the installed MariaDB related yum packages. The package name needs to be determined according to the result of the yum list command. This step requires root privileges. yum remove mariadb-libs Download MySQL rpm package Since the software package is very large, you can download it using other methods (such as Thunder) first. Using the rpm method, you can also install it without an internet connection - this is something that yum cannot do. If you need to install other versions of MySQL, please go to the official website and search for the corresponding rpm download link. Copy the code as follows: wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar Install MySQL using rpm package The following steps require root privileges. And because of the dependencies between packages, each rpm command must be executed in sequence. mkdir mysql-5.7.18 tar -xv -f mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar -C mysql-5.7.18 cd mysql-5.7.18/ rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm After successful installation, you can also delete the installation files and temporary files. cd .. rm -rf mysql-5.7.18 rm mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar Change the initial MySQL password The following steps require root privileges. 1. Since you don’t know the password at the beginning, first modify the configuration file /etc/my.cnf to let MySQL skip the permission check when logging in. Add a line: skip-grant-tables 2. Restart MySQL. service mysqld restart 3. Log in to MySQL without password. mysql 4. Execute the following command in the mysql client to change the root password. use mysql; UPDATE user SET authentication_string = password('your-password') WHERE host = 'localhost' AND user = 'root'; quit; 5. Modify the configuration file /etc/my.cnf to delete the previously added line skip-grant-tables and restart MySQL. This step is very important and failure to perform it may lead to serious safety issues. 6. Log in using the password you just set. mysql -u root -p 7.MySQL will force you to change your password, and it cannot be a simple rule password. ALTER USER root@localhost IDENTIFIED BY 'your-new-password'; The steps may seem a bit cumbersome, and I haven't thought of any other solution yet, so just use it this way for now. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: jQuery treeview tree structure application
>>: Detailed explanation of software configuration using docker-compose in linux
1. Preparation 1.1 Download the Python installati...
Here we only introduce the relatively simple inst...
Table of contents 1. JavaScript uses canvas in HT...
1. What is an index? An index is a data structure...
This article will introduce how to use explain to...
For work needs, I need to make a mobile phone adap...
First, install PHP5 very simple yum install php T...
Table of contents What is VUE Core plugins in Vue...
Table of contents 1. setState() Description 1.1 U...
1. Inline style, placed in <body></body&g...
Previous This is a classic old question. Since a ...
<br />For some time, I found that many peopl...
Database modification or deletion operations may ...
mysql 5.6.35 winx64 free installation version con...
Table of contents Introduction Example: Event del...