ARCHETYPE - SQL

I have managed to source some credentials for the SQL server, however, I get an error when trying to log in with mysql:

mysql -h 10.10.10.27 -P 1433 -p password -u username

password and username substitued so this is not a spolier…

any reason tjhis won’t connect - i get an error

“Lost connection to MySQL server at 'reading initial communication packet, system error: 0”

Nudges would be greatly appreciated

s

Type your comment> @MoeSyzslak said:

s

Double check the database type.

It usually indicates network connectivity trouble and you should check the condition of your network if this error occurs frequently. It might be because the MySQL server is bound to the loop-back IP (127.0.0.1 / localhost) which effectively cuts you off from connecting from “outside”. If this is the case, you need to upload the script to the webserver (which is probably also running the MySQL server) and keep your server host as ‘localhost’ Another common cause of connect timeouts is the reverse-DNS lookup that is necessary when authenticating clients. It is recommended to run MySQL with the config variable in my.cnf:

  • Open mysql configuration file named my.cnf and try to find “bind-address”, here replace the setting (127.0.0.1 OR localhost) with your live server ip (the ip you are using in mysql_connect function).

  • Restart service by command : service httpd restart

  • GRANT ALL PRIVILEGES ON yourDB.* TO ‘username’@‘YOUR_APPLICATION_IP’ IDENTIFIED BY ‘YPUR_PASSWORD’ WITH GRANT OPTION;