1

I installed apache server (this story). I cannot connect with remote (I tried local too) mysql server. After a long loading page I get error MySQL database connect failure. Mysql server is far from me. On same page which locate in Internet with same settings is good work. How to solve this?

When I typed in terminal:

mysql -u username -h x.xx.xx.x -p

After a minute I get:

ERROR 2003 (HY000): Can't connect to MySQL server on 'xxxxxxxxx' (110)

I cannot visit localhost/phpadmin/, because I get 403 error. I doubt the correctness of the phpadmin settings...

serezha93
  • 31
  • 1
  • 2
  • 6
  • what is the URL are you trying to access to your server. you'll need phpmyadmin to access the database. If I'm not mistakn, lamp has it all with pack. Try, http://localhost/phpmyadmin – AzkerM Apr 16 '14 at 18:49

3 Answers3

0

I think you should allow IP or port 3306 on firewal and grant permission for user@IP for local visit with command:

sudo ufw allow from IP/subnet to any port 22
  • Grant permission user connect from remote on Mysql:

    GRANT ALL PRIVILEGES ON *.* TO root@'IP' IDENTIFIED BY 'password' with grant option;
    

    flush privileges;

Kotler
  • 589
0

How are you connecting to the database, if it is with php try

mysql_connect("localhost", username, password);

with localhost as your host.

viktorstrate
  • 163
  • 1
  • 1
  • 8
0

Open up your terminal or console and type the following:

mysql -u username -h x.xx.xx.x -p

then enter your password

This gives you the assurance that the connection from your host it works, and if not, return a useful error output.

girardengo
  • 4,965
  • 1
  • 26
  • 31