In linux, mysql enables the remote access function. 1. After mysql is successfully installed, the remote access permission is disabled by default, only the local database can access mysql. The default configuration is actually in the user table of the mysql user in the mysql database. You only need to modify the relevant records in this table for specific viewing methods, as shown in: 2. Add a new user for authorization # grant all privileges on *. * to created username @ "%" identified by "password"; # flush privileges; # refresh the content # format: grant permission on Database Name. table name to user @ login host identified by "User Password"; # @ is followed by the Client IP address (or host name) for accessing mysql) % represents any client # If localhost is set to local access (then this user cannot remotely access the mysql database ). 3. set remote access permissions for existing users # use mysql; # update db set host = '%' where user = 'username '; # If it is written as host = localhost, this user does not have the remote access permission # flush privileges; 4. view the modified result # use mysql; # select host, user, password from user;