允许从给定IP范围访问MySQL

时间:2017-04-09 05:56:42

标签: mysql mysql-workbench

通常,我使用host" localhost"。但现在我希望允许MySQL Workbench访问。 Workbench位于具有IP 10.x.x.x的Windows PC上,而MySql位于10.y.y.y.我试过以下无济于事。这是如何完成的?

CREATE USER 'myUserName'@'10.%' IDENTIFIED BY 'myPassword';
GRANT ALL PRIVILEGES ON * . * TO 'myUserName'@'10.%';

这是导出用户时phpMyAdmin显示的内容:

# Privileges for `myUserName`@`10%`

GRANT ALL PRIVILEGES ON *.* TO 'myUserName'@'10%' IDENTIFIED BY PASSWORD '*xxx';


# Privileges for `myUserName`@`10.%`

GRANT ALL PRIVILEGES ON *.* TO 'myUserName'@'10.%' IDENTIFIED BY PASSWORD '*xxx';


# Privileges for `myUserName`@`localhost`

GRANT ALL PRIVILEGES ON *.* TO 'myUserName'@'localhost' IDENTIFIED BY PASSWORD '*xxx' WITH GRANT OPTION;

0 个答案:

没有答案