從其他電腦拜訪本機的Mysql的設置辦法。本站提示廣大學習愛好者:(從其他電腦拜訪本機的Mysql的設置辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是從其他電腦拜訪本機的Mysql的設置辦法正文
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:
譯文:假如須要讓特定的用戶從給定域(例如mydomain.com)的一切盤算機上拜訪 MySQL 辦事器,你可以履行在賬戶名的 host 部門應用了通配符“%” 的 GRANT 語句
mysql> GRANT ...
-> ON *.*
-> TO 'myname'@'%.mydomain.com'
-> IDENTIFIED BY 'mypass';
To do the same thing by modifying the grant tables directly, do this:
譯文:也能夠應用直接修正受權表的方法來完成:
mysql> INSERT INTO user (Host,User,Password,...)
-> VALUES('%.mydomain.com','myname',PASSWORD('mypass'),...);
mysql> FLUSH PRIVILEGES;
再來處理成績:
1、許可用戶 wp 從 192.168.2.98 登錄 MySQL 辦事器(上面的實例均為登錄辦事器192.168.2.28)
(1)先在MySQL中受權:grant select,update,insert,delete on mysql.* to 'wp'@'192.168.2.98' identified by '123';
(2)再用VFP銜接:SQLSTRINGCONNECT("driver={mysql odbc 3.51 driver};server=192.168.2.28;uid=wp;pwd=123;port=3306;")
假如有多個網址,分離履行受權便可以了。
2、許可用戶 wp 從某個網段登錄 MySQL 辦事器
(1)先在MySQL中受權:grant select,update,insert,delete on mysql.* to 'wp'@'192.168.2.%' identified by '123';
(2)再用VFP銜接:SQLSTRINGCONNECT("driver={mysql odbc 3.51 driver};server=192.168.2.28;uid=wp;pwd=123;port=3306;")
3、許可用戶 wp 從任何網址登錄 MySQL 辦事器
(1)先在MySQL中受權:grant select,update,insert,delete on mysql.* to 'wp'@'%' identified by '123';
(2)再用VFP銜接:SQLSTRINGCONNECT("driver={mysql odbc 3.51 driver};server=192.168.2.28;uid=wp;pwd=123;port=3306;")