Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Graphic and text tutorial of mysql 8.0.16 installation and configuration method under CentOS7

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Uninstall the older version of MySQL (skip this step if you don't)

(note: step 3-6 to reinstall the new version of MySQL, be sure to uninstall the previous version cleanly, or there will be no errors; for the new virtual machine, you can install MySQL in only 1-2 steps.)

1. View older versions of MySQL

Rpm-qa | grep mysql

two。 Delete old components one by one

Use the command rpm-e-- nodeps {- file-name} to remove. There may be dependencies when removing, so pay attention to a certain order.

After deletion, check to see if there is any old version.

3.rm-rf / var/lib/mysql

Rm / etc/my.cnf

4.find /-name mysql

Clear all directories, files and other configurations and settings related to the mysql. If so, delete it. It must also be considered that other software will not affect it.

Rm-rf / usr/lib/mysqlrm-rf / usr/share/mysqlwhereis mysql

6. Self-booting service

Chkconfig-- list | grep-I mysqlchkconfig-- del mysqld

Install MySQL

1. Upload the MySQL installation package to the / usr/local/mysql/ folder on centos

two。 Enter into / usr/local/mysql/

3. Start installing MySQL

Use the command rpm-ivh {- file-name} to install.

Install RPM package dependencies according to dependencies: common → libs → client → server

Note: in ivh, i-install installation; v-verbose progress bar; h-hash hash check

Rpm-ivh mysql-community-common-8.0.16-2.el7.x86_64.rpmrpm-ivh mysql-community-libs-8.0.16-2.el7.x86_64.rpmrpm-ivh mysql-community-client-8.0.16-2.el7.x86_64.rpmrpm-ivh mysql-community-server-8.0.16-2.el7.x86_64.rpm

Solutions to errors in installing libs

Clear all mysql dependency packages yum remove mysql-libs in yum

4. Installation succeeded

5. Start mysql

After installation, use the command to start the MySQL service. (if the mysql service fails to start, restart the system)

Systemctl start mysqld.service (service mysqld start) starts mysqlsystemctl status mysqld.service (service mysqld status) View mysql status systemctl stop mysqld.service (service mysqld stop) closes mysql

6. Modify MySQL password

First find the password with the following command:

Grep 'temporary password' / var/log/mysqld.log

Log in to mysql with a password

Mysql-uroot-p

Change your password:

Alter user root@localhost identified by 'your password'

(note that the password here is as complicated as possible, or it will fail (ERROR 1819 (HY000): Your password does not satisfy the current policy requirements).

(if you want the password to be simple, you need to execute the following two commands first:

Mysql > set global validate_password_policy=0

Mysql > set global validate_password_length=1;)

7. Log in

Mysql-uroot-p

8. View the mysql process ps-ef | grep mysql

9. View port 3306 netstat-anop | grep 3306

10. Grant remote access to root user

1) use mysql

2) select user, host from user

3) update user set host='%' where user = 'root'

4) grant all privileges on. To 'root'@'%' identified by' tsk007' with grant option

5) Refresh permission flush privileges

11.systemctl stop firewalld.service (turn off the firewall)

Systemctl disable firewalld.service (turn off the firewall and boot up)

twelve。 Remote login (this machine must be equipped with MySQL)

Mysql-uroot-p-h (IP visited)

Reference article: the method of completely uninstalling mysql under CentOS

Wonderful topic sharing:

Installation tutorials for different versions of mysql

Installation tutorials for each version of mysql5.7

Installation tutorials for each version of mysql5.6

Installation tutorials for each version of mysql8.0

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report