Home >Database >Mysql Tutorial >How to implement the mysql operation of navicat connecting to Ubuntu virtual machine

How to implement the mysql operation of navicat connecting to Ubuntu virtual machine

王林
王林forward
2023-05-30 08:40:052491browse

1. Check the ip of the virtual machine

Open the terminal in the virtual machine and enter the command

ifconfig

How to implement the mysql operation of navicat connecting to Ubuntu virtual machine

2. Authorize mysql remote access

Enter the command in the terminal (the configuration file may have a slightly different path due to different versions)

sudo vim /etc/mysql/conf.d/mysql.cnf

Type "i" to start editing, modify bind-address = 0.0.0.0 (set to be accessible externally, If set to 127.0.0.1, it can only be accessed locally.)

How to implement the mysql operation of navicat connecting to Ubuntu virtual machine

esc key to exit editing, enter ":wq" to save and exit.

Then log in to MySQL to change permissions

mysql - uroot -p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'passwrd' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# 退出登录MySQL
exit;
# 重启服务器
service mysql restart

3. Access through navicat

How to implement the mysql operation of navicat connecting to Ubuntu virtual machine

Supplement: Navicat connects to mysql in the virtual machine

The following sql means to add permissions to the root user whose password is 000000

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '000000' WITH GRANT OPTION;

Navicat connects to the mysql command line

How to implement the mysql operation of navicat connecting to Ubuntu virtual machine

The above is the detailed content of How to implement the mysql operation of navicat connecting to Ubuntu virtual machine. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete