Get the App
SLTechnology News&Howtos  ›  Database  › 

Connect to the mysq database using navicat

Shulou Source: shulou.com Published: 2022-06-01 08:13:34 10月28日 Update

Requirements: method of connecting mysql database on windows operating system 1: connect with SSH of Navicat

First, let's create a new connection in Navicat.

General (general)-only fill in (login username and password of the database)

Note: the hostname and IP address (localhost) and port (3306) do not need to be changed

two。 Then click-SSH

Note: configure the IP address, host user name and password of the server where mysql is located

3. Finally, click the test button in the lower left corner. (this will be ``ok).

# # #

Method 2: use IP address to remotely connect to mysql database

1. First, open Navicat to create a new connection. This time we directly enter the IP address of our remote host on the regular page | user name, password and port (3306) remain the same (database user name and password)

Next, we need to execute the following statement in mysql (open mysql remote permissions)

GRANT ALL PRIVILEGES ON *. * TO 'myuser'@'%' IDENTIFIED BY' mypassword' WITH GRANT OPTION

Grant all privileges on. To 'root'@'%'identified by' Flzx3qcfolk' With grant option

Query OK, 0 rows affected, 1 warning (0.01 sec) ~ ~

PS:myuser changes your database user name to root mypassword and changes to database login password.

After opening the remote permissions, we also need to modify the vim / etc/my.cnf file

Change bind-address = 127.0.0.1 to bind-address = 0.0.0.0

After modifying the configuration file, restart the mysql service:

(systemctl restart mysql) or

(systemctl stop mysql)-- (systemctl start mysql)

At this point, we can manipulate mysql on windows in two ways.

# # #

Note: the firewall must be turned off, otherwise it cannot be connected remotely.

Linux7 turn off the firewall:

1. View firewall status: systemctl status firewalld

two。 Check to see if the firewall service is started when powered on: systemctl is-enabled firewalld

3. Turn off and check the firewall: systemctl stop firewalld / systemctl status firewalld

4. Disable firewall (boot does not boot) systemctl disable firewalld / systemctl is-enabled firewalld

Tags: Data database firewall fire protection password user user name address host method service general file permissions port open login configuration next operating system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Xiaomi Shulou Information vpn Linux