Page 1 of 1

"Cannot login to MYSQL" ERROR: 1045

PostPosted: 15. February 2013 03:08
by ajfbiz
Dear Forum,
I just installed Xampp v3.1.0.3.1.0 and all running fine--except mySQL login error. I'm sure there must be a problem in config -- somewhere! -- I've checked httpd.conf....phpmyadm: config.inc.php .... mySQL: my.ini, my.cnf, my-large.ini....it's no wonder it's confused, or I guess,
I'm the one confused.
Anyhow the passwords all agree in the above mentioned config files.
There are two inconsistencies that I wish someone would explain: Apache CGI(working fine) wants "localhost" for server name.
MySQL does not recognize this, it wants--I think-- 127.0.0.1.
SECOND problem: the my.ini file wants user password, but there is no "user" specification under "[Client]" .... so does this mean
that the password is for "root"??
The documentation does not seem to address this , but when I try to login in as "root" that's when the above error occurs. If it does not want "root" then why no spec in my.ini for a username??

Appreciate any help and/or clarification.

Alan

Re: "Cannot login to MYSQL" ERROR: 1045

PostPosted: 15. February 2013 06:35
by Altrea
Hi ajfbiz,

Please report us full error messages not just the error number. That would make helping you a bit easier and your thread will be easier found for others with the same problem.

ajfbiz wrote:I just installed Xampp v3.1.0.3.1.0

v3.1.0 is not the XAMPP version number, but the XAMPP control panel version number. So i am assuming you are using the current XAMPP version 1.8.1

ajfbiz wrote:There are two inconsistencies that I wish someone would explain: Apache CGI(working fine) wants "localhost" for server name.
MySQL does not recognize this, it wants--I think-- 127.0.0.1.

Then localhost is not translated to 127.0.0.1 but for example to IPv6 localhot ip ::1. By default MySQL server don't listens on IPv6.

ajfbiz wrote:SECOND problem: the my.ini file wants user password, but there is no "user" specification under "[Client]" .... so does this mean
that the password is for "root"??

Your my.ini don't need to have a password configurated. MySQL has implemented a very powerful user control system not because others should define their root passwords in a configuration file. Yes, MySQL documentation has a paragraph about saving password in configuration files, but that is far away from being best practice and is not the way XAMPP handles it.

ajfbiz wrote:Appreciate any help and/or clarification.

Okay, assuming you get this error in phpmyadmin:
  • Do you have executed the XAMPP security script to define a new root password?
  • Do you have configurated that password in your \xampp\phpmyadmin\config.inc.php file?
  • Do you have configurated a different auth_type in your \xampp\phpmyadmin\config.inc.php?

Also read other threads at this boards about resetting root password in MySQL, like this one: viewtopic.php?f=16&t=52703&p=202243&hilit=MySQL#p202243

best wishes,
Altrea

Re: "Cannot login to MYSQL" ERROR: 1045

PostPosted: 15. February 2013 22:37
by ajfbiz
Altrea;
OK, I followed up on your three final questions and could answer no, but now yes and voila....phpmyadmin allowed my login....finally made it to square A!

Thanks, Altrea

Re: "Cannot login to MYSQL" ERROR: 1045

PostPosted: 24. March 2013 08:59
by Willem.Norval
Hi There, I cannot login to localhost MySQL. Can anybody help ?

When I run my createmovie.php file :
Warning: mysql_connect(): Access denied for user 'bp5am'@'localhost' (using password: YES) in C:\xampp\htdocs\test\createmovie.php on line 4

Code in my createmovie.php file :
//connect to MySQL; note we've used our own parameters - you should use
//your own for host name, user and password
$connect = mysql_connect("localhost", "bp5am", "bp5ampass") or
die ("Hey, check your server connection.");

On the xampp-control.log :
05:38:58 PM [main] Control Panel Version: 3.1.0 Beta 4 [ Compiled: September 20th 2012 ]
05:38:58 PM [main] You are not running with administrator rights! This will work for
05:38:58 PM [main] most application stuff but whenever you do something with services
05:38:58 PM [main] there will be a security dialogue or things will break! So think
05:38:58 PM [main] about running this application with administrator rights!

Could it be that I have to change my administrator rights ? Where and how do I do that ?

Re: "Cannot login to MYSQL" ERROR: 1045

PostPosted: 24. March 2013 12:07
by Altrea
Hi Willem.Norval,

Willem.Norval wrote:Could it be that I have to change my administrator rights ? Where and how do I do that ?

No, thats not your issue. But you should do that too.
Simply right click the control panel icon and click "run as Administrator"

Willem.Norval wrote:Warning: mysql_connect(): Access denied for user 'bp5am'@'localhost' (using password: YES) in C:\xampp\htdocs\test\createmovie.php on line 4

Everything important is in that line.
  • Does the user bp5am exists in your database?
  • Is the user permitted to login from localhost?
  • Are you really really sure you have tried the correct password for that user?
One of these is your issue.

best wishes,
Altrea