LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   DBI Connect Failed:Access denied for user ''@'localhost' to database <database> error (https://www.linuxquestions.org/questions/linux-software-2/dbi-connect-failed-access-denied-for-user-%40localhost-to-database-database-error-730755/)

kaplan71 06-04-2009 05:22 PM

DBI Connect Failed:Access denied for user ''@'localhost' to database <database> error
 
Hi there --

I am trying to run a mysql 5.0.56 distribution, and whenever I try to either change the root password, or create a database, the following error message appears:

Quote:

DBI Connect Failed:Access denied for user ''@'localhost' to database <database>
The database was installed via yum onto a CentOS 5.3 server. I tried removing, and then reinstalling the database via yum, but the results were the same. What do I need to do in order to correct this problem?

irishbitte 06-04-2009 06:35 PM

Put these commands in exactly as I describe them, one line after another. Don't forget the semi-colon:
Code:

mysql -u root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyPW');
exit

obviously changing MyPW to something you are happy with.

kaplan71 06-04-2009 06:48 PM

Hi there --

Thanks for your reply. I went through the commands that you listed, but the error message I got was the following:

Quote:

ERROR 1133 (42000): Can't find any matching row in the user table
What is the next move to make? Thanks.

irishbitte 06-05-2009 12:39 PM

Hmmm. Took a quick google search of your last error message, and found this: http://ircarchive.info/mysql/2007/4/13/15.html. See if that helps. I reckon you're typing ROOT instead of root, am I correct?


All times are GMT -5. The time now is 03:47 PM.