How to Set Mysql access from other computers

Source: Internet
Author: User
To allow a specific user to access the MySQL server from all computers in a given domain (such as mydomain.com), you can run the GRANT statement with the wildcard "%" in the host part of the account name.

To allow a specific user to access the MySQL server from all computers in a given domain (such as mydomain.com), you can run the GRANT statement with the wildcard "%" in the host part of the account name.

If you want to give a specific user access from all machines in a given domain (for example, mydomain.com ), you can issue a GRANT statement that uses the '%' wildcard character in the host part of the account name:
If you want a specific user to access the MySQL server from all computers in a given domain (for example, mydomain.com, you can run the GRANT statement with the wildcard "%" in the host part of the account name.
Mysql> GRANT...
-> ON *.*
-> TO 'myname' @ '% .mydomain.com'
-> Identified by 'mypass ';

To do the same thing by modifying the grant tables directly, do this:
You can also directly modify the authorization table:
Mysql> insert into user (Host, User, Password ,...)
-> VALUES ('% .mydomain.com', 'myname', PASSWORD ('mypass '),...);
Mysql> flush privileges;



Solve the problem again:

1. allow user wp to log on to the MySQL server from 192.168.2.98 (the following instances are logon servers 192.168.2.28)
(1) authorize in MySQL: grant select, update, insert, delete on mysql. * to 'wp '@ '192. 168.2.98' identified by '2016 ';
(2) connect with VFP: SQLSTRINGCONNECT ("driver = {mysql odbc 3.51 driver}; server = 192.168.2.28; uid = wp; pwd = 123; port = 3306 ;")

If you have multiple URLs, You can authorize them separately.

2. Allow wp to log on to the MySQL server from a certain network segment
(1) authorize in MySQL: grant select, update, insert, delete on mysql. * to 'wp '@ '192. 192. %' identified by '2016 ';
(2) connect with VFP: SQLSTRINGCONNECT ("driver = {mysql odbc 3.51 driver}; server = 192.168.2.28; uid = wp; pwd = 123; port = 3306 ;")

3. allow user wp to log on to the MySQL server from any website
(1) authorization in MySQL: grant select, update, insert, delete on mysql. * to 'wp '@' % 'identified by '20140901 ';
(2) connect with VFP: SQLSTRINGCONNECT ("driver = {mysql odbc 3.51 driver}; server = 192.168.2.28; uid = wp; pwd = 123; port = 3306 ;")

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.