Current location - Quotes Website - Team slogan - How does linux connect to remote mysql?
How does linux connect to remote mysql?
Methods/steps

Connect to the Linux system remotely, and make sure that the MySQL database is installed on the Linux system. Log in to the database. Mysql -uroot -p (password)

Create a remote connection for users to use.

Grant all permissions on *. * TO 'itoffice'@'%' is identified by' itoffice' with GRANT option;

(The first I office indicates the user name,% indicates that all computers can connect, or you can set an ip address to run the connection, and the second I office indicates the password).

Execute refresh permission; The order takes effect immediately.

Users who query the database (seeing the following indicates that the new user was created successfully)

SELECT DISTINCT CONCAT ('user:'', user,'' @'', host,''';' ) as a query from mysql.user;

Use the exit command to exit MySQL.

Then open vim/etc/MySQL/my.cnf.

Binding address = 127.0.0. 1.

Set to bind-address = 0.0.0.0 (device address).

Restart (the command is as follows):

/etc/init.d/mysql stop.

/etc/init.d/mysql startup

View port number

Display global variables, such as "port";

Set up the navicat connection.

Click on the connection test, and the following content indicates success.