HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Unable to login to MYSQL as root (http://www.howtoforge.com/forums/showthread.php?t=50308)

sellotape 1st December 2010 15:22

Unable to login to MYSQL as root
 
Hi there.

I can't login as root - I know that my login details are correct but when I login it says permission denied.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

ISPConfig3.03 reports an error in red in the system log as...
2010-12-01 00:34 192.168.1.69 Error Unable to connect to the database:

I tried changing my root password by starting mysqld in safe mode as advised here...
Quote:

# /etc/init.d/mysqld stop
# /usr/bin/mysqld_safe --skip-grant-tables --skip-networking &
# mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD("your password here") WHERE User="root";
mysql> exit

# /etc/init.d/mysqld stop
# /etc/init.d/mysqld start
However I get this message...

Code:

Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

I can login to the existing databases in ISPConfig 3.03 but when I attempt to create a new database - ISPConfig states it's all good to go but I am unable to login at all.

I'm not sure what to do next!

Thanks


Ash

till 1st December 2010 15:37

Looks as if you dont have a root user in your mysql setup anymore. You can check this e.g. with the command:

SELECT * FROM mysql.user WHERE User="root"

Quote:

but when I attempt to create a new database - ISPConfig states it's all good to go but I am unable to login at all.
If you dont have a root user in mysql or the password is wrong, then ispconfig can not create databases as it logs into mysql to create the databases as root user.

sellotape 1st December 2010 15:40

Hi there Till.

Thanks for your help.
I wondered if user - root had been removed but don't remember removing it!

I am still quite new to command line and centos - can you tell me how I would go about recreating user root please?

Bearing in mind at present I am unable to login to MYSQL at all and only in safe mode.

Many thanks


Ash

falko 2nd December 2010 15:41

http://forums.mysql.com/read.php?30,13701,62421


All times are GMT +2. The time now is 10:53.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.