0

I installed MySQL server and everything worked fine in command line. I worked connecting MySQL to my ASP.NET application and there is no problem at all. But when I try to connect MySQL to PHP applications I am unable to connect. When I installed PHPMyAdmin I am getting error #2002 Connot log in to thie MySQL server

I browsed all the night for this error and none of Google's results helped me! :(

Anybody can you please tell me where the problem is at? I believe I must change my PHP.ini file settings in order to connect to MySQL. Anybody please help me.

3
  • Welcome to Database Administrators, Karthik. This is probably a question more suited to serverfault, though. Commented Oct 12, 2011 at 11:36
  • Since the database is working correctly, and you're having programmatic access issues, I think that you're more likely to find experts in another forum. We shall do our best to connect you with those right experts ... Commented Oct 12, 2011 at 15:05
  • I think you should consider this: upcode.wordpress.com/2011/09/08/… Commented Oct 12, 2011 at 15:32

2 Answers 2

1

There are a lot of things that can cause this type of issue. Did you make sure that you have added php-mysql drivers to your sever. Since you said your using ASP i will assume that you are using windows servers. Make sure that you also are allowing that user to connect via localhost or what ever ip the PHP is on.

In php there are to standered ways of connecting to a MySQL database.

  1. php-mysql(is going to be depercated soon).
  2. php-mysqli(OOP version of the php-mysql with lots of features).

With out one of these php will be unable to work with a MySQL database. I am not sure if phpmyadmin works with both drivers or just one of them It could be throwing a die("message") Just to let you know it is not working instead of throwing a more complex php error. You may want to see if you can incress error reporting.

You can check if your php installastion has the mysql driver by looking in your php.ini and also checking with.

phpinfo();
Sign up to request clarification or add additional context in comments.

Comments

0

It is almost always about config. https://bbs.archlinux.org/viewtopic.php?id=90133

Comments

Your Answer

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