1

I have a Host enayam.in (linux) i have mysql db in this Host.

Actually i have to access it on my Localhost(With WAMP or MAMP)

if the Database in localhost(WAMP or MAMP) then i can connect my DB like this

mysql_connect('localhost', 'root', 'root');
mysql_select_db('testDB');

now i try to access my enayam.in DB in my localhost(WAMP or MAMP)

mysql_connect('enayam.in', 'enayamin_dbuser', 'enayamin_dbpassword');
mysql_select_db('enayamin_testDB');

but its giving error, i also try with my server IP as host (75.126.136.20)

mysql_connect('75.126.136.20', 'enayamin_dbuser', 'enayamin_dbpassword');
mysql_select_db('enayamin_testDB');

eventhough its giving error. please help me to solve this issue.

Thanks in advance

1
  • 1
    What is the error? Have you added your own IP address in trsuted IPs in cPanel of your host? ( IPs which can connect to your DB remotely ) Commented Nov 27, 2011 at 12:30

2 Answers 2

2

cPanel > Remote MySQL > Add your IP address. Use % as a wildcard ex. 64.65.54.%

Sign up to request clarification or add additional context in comments.

2 Comments

I am using MAMP on Mac OS X. What would be my I.P? Sorry for late Reply!
Use the ip address of the machine you are trying to connect from. To find out what your ip address is go to www.whatismyip.com.
1

To access a database from the local system, the remote access for your db has to be enabled in your server.

Just refer this link to enable remote access http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.