Method 1:
Try to log in to MySQL Server using the MySQL Adminstrator GUI Tool, but the Server replies with an error message: Host '60-248-32-13.HINET-IP.hinet.net' is not allowed to connect to this
MySQL server.
This is because of permissions. The problem is handled as follows:
shell>mysql --user=root -p
enter password
mysql>use mysql
mysql>GRANT SELECT,INSERT,UPDATE,DELETE ON [db_name].* TO [username]@[ipadd] identified by ' [password]';
[username]: User code for remote login
[db_name]: Indicates the name of the database to be opened to users
[password]: User password for remote login
[ipadd]: IP address or IP reverse check DNS Name, in this example, you need to fill in '60-248-32-13.HINET-IP.hinet.net', and put quotation marks (') in the package
(in fact, it is executed on the remote server, and the address fills in the local host) ip address.)
If you want to open all permissions, please execute:
mysql>update user set select_priv='Y', Insert_priv='Y', Update_priv='Y', delete_priv='Y', Create_priv='Y', Drop_priv= 'Y',Reload_priv='Y', shutdown_priv='Y', Process_priv='Y', File_priv='Y', Grant_priv='Y', references_priv='Y',Index_priv='Y', Alter_priv='Y ', Show_db_priv='Y', Super_priv='Y',Create_tmp_table_priv='Y',Lock_tables_priv='Y', Execute_priv='Y',Repl_slave_priv='Y',Repl_client_priv='Y' where user='[username] ';
Method 2:
How to solve the connection between client and server (mysql): xxx.xxx.xxx.xxx is not allowed to connect to this mysql serv
1. Enter mysql and create a new user xuys:
Format: grant permissions on database Name.Table name user@login host identified by "user password";
grant select,update,insert,delete on *.* to [email protected] identified by "xuys1234";
to view the results, execute:
use mysql;
select host, user, password from user;
You can see that the xuys user just created is already in the user table. The host field represents the logged-in host. Its value can be IP or host name.
Changing the value of the host field to % means that you can log in to the mysql server as user xuys on any client machine. It is recommended to set it to % during development. .
3. ./mysqld_safe --user-root &
Remember: any modification to the authorization table requires reloading, that is, step 3.
If you still cannot connect from the client after the above 3 steps, please perform the following operations to insert a record in the db table of the mysql database:
use mysql;
insert into db values('192.168.88.234','%','xuys' ,'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
update db set host = '%' where user = 'xuys';
Repeat steps 2 and 3 above.
Method three:
Add fbysss to solve the problem of phpMyAdmin connecting to remote users:
1. Log in to the remote Mysql server with the root account,
grant select, update, insert, delete on *.* to [email protected] identified by "sss";
update user set host = '%' where user = 'sss';
Exit mysql and execute
#mysqladmin -u root -p [password] reload
#mysqladmin -u root -p [password] shutdown
#/etc/rc.d/init .d/mysqld start
2. Modify the config.inc.php file in the phpMyAdmin directory, find
$cfg['Servers'][$i]['host'] and change it to the remote server address
$cfg['Servers'][$ i]['user'] is changed to sss
$cfg['Servers'][$i]['password'] is changed to the password of sss.
It should be noted that grant all privilege does not grant the "grant" permission to the user. , if you want to add it, you can use use mysql;update user set Grant_priv ='Y' directly in mysql to meet the requirements.