You are not logged in.

#1 2011-10-18 22:56:18

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

MySQL - how can I change an IP address restriction for a user [solved]

I'm getting "Host ... is not allowed to connect to this MySQL server" when attempting to connect to mysql.  I read this guide which gives a solution but I have no idea how to physically implement the solution.

You can fix this by setting up an account for the combination of client host name and user name that you are using when trying to connect.

I want to change the access from "localhost" to any address on my LAN (192.168.0.*) for user facade, but am unsure of the proper syntax.

#  mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 53
Server version: 5.5.16-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select host, user from mysql.user;
+-----------+--------+
| host      | user   |
+-----------+--------+
| 127.0.0.1 | root   |
| ::1       | root   |
| localhost | facade |
| localhost | root   |
+-----------+--------+
4 rows in set (0.00 sec)

Last edited by graysky (2011-10-18 23:37:54)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2011-10-18 23:30:54

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: MySQL - how can I change an IP address restriction for a user [solved]

Host can be a combination of IP/netmask. In your case, something like:

UPDATE mysql.user SET host = '192.168.0.0/255.255.255.0' WHERE user = 'facade'

Offline

#3 2011-10-18 23:37:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: MySQL - how can I change an IP address restriction for a user [solved]

Thanks falcon.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB