Il caso è simile:
mysql connects will localhost when network is not up.
mysql cannot connect when network is up.
si può provare la seguente procedura per diagnosticare e risolvere il problema (la mia ipotesi è che qualche altro servizio sta bloccando la porta su cui è ospitato mysql):
1. Disconnect the network.
2. Stop mysql service (if windows, try from services.msc window)
3. Connect to network.
4. Try to start the mysql and see if it starts correctly.
5. Check for system logs anyways to be sure that there is no error in starting mysql service.
6. If all goes well try connecting.
7. If fails, try to do a **telnet localhost 3306** and see what output it shows.
8. Try changing the port on which mysql is hosted, default 3306, you can change to some other port which is ununsed.
Questo dovrebbe idealmente risolvere il problema che si sta affrontando.
fonte
2013-05-17 03:44:35
Hai provato a eseguire il ping di localhost con la rete? –
Spero che questo articolo ti possa aiutare: http://faq.webyog.com/content/23/17/en/error-no-2005-unknown-mysql-server-host.html –
@Himanshu Bhardwaj: ci proverò domani quando appare l'errore, grazie per la risposta! – user2388626