-1

I have two device on my network LB (192.168.1.10) and RP1 (192.168.0.20) I am wanting all the MySQL stuff to be hosted on the LB and all the web stuff to be hosted on the RP1.

I have installed mysql-server-5.5 on both devices. But when I perform the command:

$con=mysqli_connect("192.168.1.10","foo","password","max");

On the web page I get the error:

Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL server on '192.168.1.10' (111) in /var/www/example.info/public_html/submit.php on line 6

And obviously when I try localhost (replacement for "192.168.1.10" in the snippet above) I get the error:

Warning: mysqli_connect(): (28000/1045): Access denied for user 'max'@'localhost' (using password: YES) in /var/www/example.info/public_html/submit.php on line 6


I have also tried:

$mysql --host=192.168.1.10

On the RP1 and I get the error:

ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.10' (111)


What am I doing wrong?

0

1 Answer 1

0

I found that you have to edit the file /etc/mysql/my.cnf and make the bind-address the ip address you would like to give access to. And if you would like all you write 0.0.0.0

Not the answer you're looking for? Browse other questions tagged .