Recorded MySQL 5.7.9 installation tutorial, share with everyone Environment Introduction: Operating system: Centos 7.1 MySQL database version: mysql5.7.9 MySQL official website: http://www.mysql.com 1. Before installing the new version of MySQL, we need to uninstall the mariadb-lib that comes with the system [root@5201351 ~]# rpm -qa|grep mariadb mariadb-libs-5.5.41-2.el7_0.x86_64 [root@5201351 ~]# rpm -e mariadb-libs-5.5.41-2.el7_0.x86_64 --nodeps 2. Go to the official website of MySQL and download the latest version of MySQL rpm collection package: mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar 3. Upload mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar to the Linux server and decompress the tar package 4. The simplest way to install the mysql-server service is to install the following four packages. We can use the rpm -ivh command to install them. mysql-community-common-5.7.9-1.el7.x86_64.rpm 5. Next is to initialize the database. We can use the following commands, and the effects are the same. [root@5201351 ~]# mysql_install_db --datadir=/var/lib/mysql //Datadir must be specified. After execution, the ~/.mysql_secret password file will be generated [root@5201351 ~]# mysqld --initialize //This method is recommended for the new version. The execution will generate a random password in /var/log/mysqld.log 6. Change the user and group of the MySQL database directory, and then start the MySQL database [root@5201351 ~]# chown mysql:mysql /var/lib/mysql -R [root@5201351 ~]# systemctl start mysqld.service //Start the mysql database service 7. Log in to MySQL according to the password in step 5 and change the password of the root user. The new version of MySQL cannot execute any commands before changing the password after the first login. [root@5201351 ~]# mysql -uroot -p')j#)=uRig4yJ' mysql> set password=password('www.cnblogs.com/5201351'); 8. Finally, we can also create users and assign permissions according to actual conditions. mysql> create user 'root'@'192.168.100.2' identified by 'QQ5201351'; mysql> GRANT ALL PRIVILEGES ON dbname.* to 'root'@'192.168.100.2'; mysql> flush privileges Finally, one thing that needs special attention is that there is no Password field in the user table under the new version of MySQL database. Instead, the encrypted user password is stored in the authentication_string field 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:
|
<<: Detailed explanation of routing parameter passing and cross-component parameter passing in Vue
>>: vue cli3 implements the steps of packaging by environment
1. Overview There are three ways to create a Dock...
Table of contents 1. Pull the image 2. Run the im...
Table of contents Overview How to share data betw...
background go-fastdfs is a distributed file syste...
Table of contents 1. Union Type 2. Crossover Type...
1. Installation and use First, install it in your...
Examples: Through the PHP background code, you ca...
Learned ConcurrentHashMap but don’t know how to a...
This article describes the usage of MySQL stored ...
<br />Previous Web Design Tutorial: Web Desi...
Table of contents How to display SQL log? ? Descr...
Preface: It’s the end of the year, isn’t it time ...
Table of contents 1. Create a sql script file con...
I spent a day on it before this. Although Seata i...
Table of contents Controller type of k8s Relation...