Steve R.
Retired
- Local time
- Today, 17:27
- Joined
- Jul 5, 2006
- Messages
- 5,316
Banana, in Use access with MYSQL you wrote:
While waiting for my GPS to update itself, I experimented (based on your comments) with making a remote connection to MYSQL. Based on your comments, I was also able to use phpMyAdmin to grant the appropriate user privileges.
I found this website "How do I enable remote access to MySQL database server?"; which essentially stated that the line "bind-address = 10.10.0.1" in my.cnf be commented out. I did that, and I was able to access MYSQL remotely.
Commenting "bind-address" out seems to allow MYSQL to listen to all sources. Obviously, for security reasons the next thing to think about is how to specify a limited IP Range (Local LAN) with "bind-address". My quickie test failed "bind-address=192.168.1.%". So I will keep looking.
Your post was very informative and helped me further understand how to allow for a remote connection. In the meantime I will reset the bind-address back to 127.0.0.1.
According to this page...
Basically you need to create an entry in the host table to allow your username to log in from the client's IP.
To put it in an concrete example, here's how I have my user table set up:
Code:mysql> select user, host from mysql.user; +------+-----------+ | user | host | +------+-----------+ | root | localhost | +------+-----------+ 1 row in set (0.00 sec)
What this means that MySQL server will only accept connection from only user named 'root' from host 'localhost' (e.g. the same computer the MySQL is running on). It will not accept anyone else anywhere. If I wanted to allow my another computer on the same network to access to the MySQL, using the same user name, I have to add a new entry in the table:
Code:mysql> grant select on test.* to 'root'@'192.168.0.%'; Query OK, 0 rows affected (0.62 sec)
Note that while I used the same user, 'root', I assigned a wildcard IP meaning that the root can connect to the MySQL any where as long the IP is between 192.168.0.1 to 192.168.0.255, effectively within the network only.
The user table now looks like this:
Code:mysql> select user, host from mysql.user; +------+-------------+ | user | host | +------+-------------+ | root | 192.168.0.% | | root | localhost | +------+-------------+ 2 rows in set (0.00 sec)
You also need to grant the appropriate permissions (e.g. SELECT, INSERT, UPDATE, etc.)
More info on GRANT statement.
HTH.
While waiting for my GPS to update itself, I experimented (based on your comments) with making a remote connection to MYSQL. Based on your comments, I was also able to use phpMyAdmin to grant the appropriate user privileges.
I found this website "How do I enable remote access to MySQL database server?"; which essentially stated that the line "bind-address = 10.10.0.1" in my.cnf be commented out. I did that, and I was able to access MYSQL remotely.
Commenting "bind-address" out seems to allow MYSQL to listen to all sources. Obviously, for security reasons the next thing to think about is how to specify a limited IP Range (Local LAN) with "bind-address". My quickie test failed "bind-address=192.168.1.%". So I will keep looking.
Your post was very informative and helped me further understand how to allow for a remote connection. In the meantime I will reset the bind-address back to 127.0.0.1.