Use Navicat under Windows to connect to MySql under Linux Centos, a virtual machine

Today, I want to use Navicat to remotely connect to the MySQL database in the virtual machine, but I still can’t connect to it. I searched the Internet and found that the reason is MySQL's authorization problem for remote user login. Here is the solution after I referenced several documents online:

First, use root privileges to enter MySql

mysql -uroot(这里是你的MySQL用户名) -p123456(这里是你的MySQL密码)

One

2. Then grant permissions to other computers

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
##(这里不要搞错用户名和密码,是你自己的)

two
At this time, connect to MySQL remotely through Navicat and test the link, as shown in the figure below. This is a successful connection.
Insert three picture descriptions here

Insert picture four description here
Reference documents: The first chapter The second

Guess you like

Origin blog.csdn.net/weixin_42345596/article/details/108768245