patternsqlMinor
MySQL: bind-address 0.0.0.0 in my.cnf does not work?
Viewed 0 times
addresscnfmysqlworkdoesbindnot
Problem
I'm new to mysql.
I want to connect to mysql server using whatever ip I want.
I read that all I have to do is to add to my.cnf file the line bind-address = 0.0.0.0.
That's what I did.
I restarted mysql server and then I tested it from command line.
You can see below part of the section mysqld in my.cnf file
Thank you in advance,
Nikos
I want to connect to mysql server using whatever ip I want.
I read that all I have to do is to add to my.cnf file the line bind-address = 0.0.0.0.
That's what I did.
I restarted mysql server and then I tested it from command line.
mysql -uroot -p'*password*' -h 127.0.0.1 --> Works
mysql -uroot -p'*password*' -h 192.168.2.4 (local ip address) --->
ERROR 1045 (28000): Access denied for user 'root'@'mguru.lnx.gr' (using password: YES)You can see below part of the section mysqld in my.cnf file
[mysqld]
user = mysql
port=3306
socket = /opt/lampp/var/mysql/mysql.sock
skip-external-locking
key_buffer = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
plugin_dir = /opt/lampp/lib/mysql/plugin/
#skip-networking
bind-address=0.0.0.0Thank you in advance,
Nikos
Solution
The configuration option
What you will need to do is modify MySQL's privilege system so that you are able to connect from
This is covered in the MySQL manual here.
bind-address tells MySQL what interfaces to listen on. By receiving the error Access denied for user 'root'@'mguru.lnx.gr' we can see that is actually working fine.What you will need to do is modify MySQL's privilege system so that you are able to connect from
'mguru.lnx.gr'. The potentially confusing part of privileges in MySQL is that it is the combination of a username + the host.This is covered in the MySQL manual here.
Context
StackExchange Database Administrators Q#64581, answer score: 7
Revisions (0)
No revisions yet.