Home > Database > Mysql Tutorial > body text

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

王林
Release: 2023-05-30 08:40:05
forward
2460 people have browsed it

1. Check the ip of the virtual machine

Open the terminal in the virtual machine and enter the command

ifconfig
Copy after login

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
Copy after login

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
Copy after login

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;
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template