How to connect to mysql in MapReduce temporarily?

What is the best way to connect to mysql server from another host?

  • Hi there, I have setup MySql on a separate linux server . and connecting from another Linux Server. http://localhost/my_db_test.php  | Works fine but http://xx.xx.xx.xx/my_db_test.php from another computer throws error . "Can't connect to MySql Server on xx.xx.xx.xx" I have added privileges like : GRANT ALL ON *.* to mysql@'xx.xx.xx.xx' IDENTIFIED BY 'your-root-password'; but still the error remains : any idea ? News Flash : I am able to connect to MySql server from the other linux server using command line , but PHP fails .

  • Answer:

    thanks Nupal , But it did't work . I see the same error . Cant connect to database server on "xx.xx.xx.xx" Do you have more ways to Troubleshoot it ? Update : It's strange that when i execute the below command in web server terminal it is conencted successfully, php -f simple_db_check.php output is : Connected but http://xx.xx.xx.xx/simple_db_check.php output is : Failed Any troubleshooting tips ? Answer : http://stackoverflow.com/questions/4078205/php-cant-connect-to-mysql-with-error-13-but-command-line-can

Raja Shahzad Naveed at Quora Visit the source

Was this solution helpful to you?

Other answers

update mysql.user set host='%' where user = 'mysql'; flush privileges; Assuming your userid is 'mysql' like in your GRANT statement update the 'host' column value by executing the above statement as root. The '%' means being able to connect from anywhere and you flush privileges to take immediate effect. This should do it :)

Nupul Kukreja

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.