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

MySQL8.0 installation process and Navicat remote connection under Centos7

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the relevant knowledge of "MySQL8.0 installation process and Navicat remote connection under Centos7". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

directory

CentOS7+ MySQL 8.0, yum source installation

Log in to mysql and change password

III. Remote login

1. MySQL yum source installation

2. After installation, login mysql for the first time and password configuration

3. Remote login issues (Navicat15 example)

CentOS7+ MySQL 8.0, yum source installation

1. Install mysql before you uninstall the original mysql, if not, please consider

1.1 Find the original mysql installation directory

Enter the command rpm -qa| The following lines appear after grep mysql

1.2 Delete the files that appear above in turn with the following command

1.3 Delete mysl profile

2.yum source installation mysql8.0

2.1 Download repo source

The repo source can be obtained from mysql's official website, click on the following link (download as needed, I downloaded the Linux7 version drawn in red below) https://dev.mysql.com/downloads/repo/yum/

Click Download and then click on the red circle below

2.2 After downloading, transfer the file to the virtual machine master folder/usr/local/module/via Xftp (folder can be customized)

2.3yum installation repo

yum install mysql80-community-release-el7-3.noarch.rpm

After installation, cd/etc/yum.repos.d, enter this directory and you can see the repo just added.

When finished, update the yum cache with

2.4yum install mysql

2.4.1 Modify installation version (default maximum version)

Because the latest repo source on the official website includes many versions of mysql, you can determine which version to install by modifying the enabled value of each version through cat /etc/yum.repos.d/mysql-community.repo.

cat /etc/yum.repos.d/mysql-community.repo

As you can see in the above figure, versions 5.5, 5.6 and 5.7 have an enabled value of 0, which means they are not installed.

8.0 and other tools, the enabled value is 1, for installation. The highest version is installed by default, and can be left unchanged.

2.4.2 Execute the installation command

yum install mysql-community-server

Possible problems:

Due to network issues, there may be a lack of dependencies

Delta RPMs disabled because /usr/bin/applydeltarpm not installed

In this case, you only need to install the corresponding missing dependencies

yum -y install deltarpm

In addition, due to poor network environment, slow network speed, slow connection with mysql official source and other reasons, during the installation process, there may be problems such as interruption, execute yum install many times until the installation is complete.

Log in to mysql and change password

1. Start mysql service

1.1 Open MySQL service

systemctl start mysqld

1.2 Set mysql service to boot automatically

systemctl enable mysqld

systemctl daemon-reload

1.3 View mysql service status

systemctl status mysqld

Active (running) means MySQL is running, service started successfully

2. View mysql initial login password

When mysql8.0 is installed, the default initial password has been assigned. You need to check it manually.

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

root@localhost: followed by the initial password, copy well

3. Change mysql password

Note: mysql installed in the official source defaults to password security checking plug-in (validate_password). The default password checking policy requires that the password must contain upper and lower case letters, numbers and special symbols, and the length must not be less than 8 digits. ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

3.1 Enter the database to modify the root password

mysql -uroot -p

Enter password: and then enter the password, the password is the initial password to view (that is, the thing copied in the previous step, pasted is not displayed, press the enter key directly)

Use MySQL

Run use mysql and then enter

ALTER user 'root'@'localhost' IDENTIFIED BY 'XXXXXXXXXX';

The content in single quotes is a password

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

The reason for the error is because of password policy issues, passwords cannot be too simple

Then you can check the password policy, change the password before this, otherwise you will be prompted to change your password no matter what you do.

re-enter

ALTER user 'root'@'localhost' IDENTIFIED BY '12Loang';

If it's correct, jump to 3.11.

If the same error is reported, jump directly to 3.12.

3.11 Enter the following command to view the corresponding parameters

SHOW VARIABLES LIKE 'validate_password%';

3.12 Then modify the parameters by entering the following command

set global validate_password.policy=0;

set global validate_password.length=1;

Then it is to modify the password you want to configure (I have 123456, you are free, it is recommended to use a complex password)

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

4. log in to MySQL

You can now do this by mysql -uroot -p

Enter password to login to mysql

III. Remote login

1. Change host of root user

First log in to mysql database and switch to mysql library

mysql -uroot -p123456 # -p can be directly root password

use mysql

Then check the host attribute of root user

select host,user from user;

The host of root user defaults to localhost, which needs to be changed to %(the above figure is modified) to allow remote login to the database. Enter the following command

update user set host='%' where user='root';

When the modification is complete, refresh with the following command to make the modification effective

flush privileges;

2. Log in with Navicat15

When using Navicat for Mysql to connect to MySQL 8.0, the following error is reported:

Authentication plugin 'caching_sha2_password' cannot be loaded:

This is because the navicat password encryption method is mysql_native_password, and mysql default encryption format is caching_sha2_password

Just change the root password encryption method to be the same as navicat

execution command

update user set plugin='caching_sha2_password' where user='root';

flush privileges;

Open Navicat Preminum, click Connect, and then click MySQL to display the interface shown below.

Take any link name

Enter the IP address of the virtual host where MySQL is installed.

The port is usually 3306 and will not change.

User name: root

The password is the password you use to log in to root.

Click on the test connection, and the connection will be successful.

"Centos7 MySQL8.0 installation process and Navicat remote connection" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

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

Development

Wechat

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

12
Report