MySQL database remote landing several solutions

Source: Internet
Author: User
Keywords Network programming Mysql tutorial
Tags .net address change client connect delete error error message

Can not remotely log in MySQL database solution One:

Trying to log in to the MySQL Server using the MySQL Adminstrator GUI Tool, Server returns the error message: Host '60 -248-32-13.HINET-IP.hinet.net 'is not allowed to connect to this MySQL server

This is because of the issue of permissions, treatment is 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]: Remote login user code

[db_name]: Said to be open to users of the database

[password]: User password for remote login

[ipadd]: The IP address or IP address after DNS lookup. The content of this example needs to be filled in with the quotation mark (') at '60 -248-32-13.HINET-IP.hinet.net'

(In fact, the implementation of the remote server, the address fill in the local host ip address.)

If you want to open all the 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]';

Can not remotely log in MySQL database solution two:

How to solve the client-server connection (mysql): xxx.xxx.xxx.xxx is not allowed to connect to this mysql serv

1, enter mysql, create a new user xuys:

Format: grant permissions on the database name. Table name user @ login host identified by "user password";

grant select, update, insert, delete on *. * to xuys@192.168.88.234identified by "xuys1234";

View the results, execute:

use mysql;

select host, user, password from user;

Can see in the user table has just created xuys user. Host field indicates the host login, the value can be IP, but also the host name,

Changing the value of the host field to% means that you can log in to the mysql server as an xuys user on any client machine. It is recommended that you set% at development time.

3,. / Mysqld_safe --user-root &

Remember: Any changes to the authorization table need to be reloaded, that is, the implementation of the third step.

If after the above three steps still can not connect from the client, do the following to insert a record in the mysql database db table:

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.

Can not remotely log in MySQL database solution three:

Additional fbysss to solve phpMyAdmin connection to remote users:

1. Log in as root remote MySQL server,

grant select, update, insert, delete on *. * to sss@192.168.0.114identified by "sss";

update user set host = '%' where user = 'sss';

Quit mysql, executed under the shell

#mysqladmin -u root -p [password] reload

#mysqladmin -u root -p [password] shutdown

# / etc / rc.d / init.d / mysqld start

2. Modify phpMyAdmin directory config.inc.php file, find

$ cfg ['Servers'] [$ i] ['host'] Change to a remote server address

$ cfg ['Servers'] [$ i] ['user'] Change to sss

$ cfg ['Servers'] [$ i] ['password'] Change the password to sss

Note that: grant all privilege does not grant "grant" permissions to the user, if you want to add, you can use mysql directly in mysql; update user set Grant_priv = 'Y' to meet the requirements.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.