MySQL Database is not letting me login for the first time with a blank password.

General support questions

MySQL Database is not letting me login for the first time with a blank password.

Postby jjrambo97 » 2012/04/30 00:06:49

I installed MySQL and MySQL-server and have followed the steps here - http://www.howtoforge.com/installing-ap ... s-6.0-lamp

The problem I am facing is that when you open it up for the first time it will ask you for a password, which is to be left blank because, of course, it has not been created yet, but when I try to do mysql_secure_installation it doesn't let me by with no password like it should.

Instead I get this:

In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I am 99% sure that I never created a password for it before especially considering this is the first time I installed it.

So far I haven't been able to find anything else that could be wrong with it and I have tried to remove all of the files and reinstall them but I can't get every file deleted.

If anyone knows an easy (or not so easy) way to fix this it would be appreciated.
jjrambo97
 
Posts: 3
Joined: 2012/04/29 23:19:00

Re: MySQL Database is not letting me login for the first time with a blank password.

Postby kyrunner » 2012/04/30 00:17:02

Try this command

mysql -u root -p (Then hit enter) it will ask for a password just hit (enter again)
kyrunner
 
Posts: 30
Joined: 2011/09/26 16:34:22

Re: MySQL Database is not letting me login for the first time with a blank password.

Postby jjrambo97 » 2012/04/30 01:47:38

kyrunner wrote:
Try this command

mysql -u root -p (Then hit enter) it will ask for a password just hit (enter again)


I got the same access denied message as I did initially when entering the password/blank password.
jjrambo97
 
Posts: 3
Joined: 2012/04/29 23:19:00

Re: MySQL Database is not letting me login for the first time with a blank password.

Postby kyrunner » 2012/04/30 11:19:16

Try this command

mysql_secure_installation
kyrunner
 
Posts: 30
Joined: 2011/09/26 16:34:22

Re: MySQL Database is not letting me login for the first time with a blank password.

Postby jjrambo97 » 2012/04/30 20:09:31

kyrunner wrote:
Try this command

mysql_secure_installation

That is what I did initially...
jjrambo97
 
Posts: 3
Joined: 2012/04/29 23:19:00

MySQL Database is not letting me login for the first time wi

Postby pschaff » 2012/05/01 21:38:04

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

jjrambo97 wrote:
...
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I am 99% sure that I never created a password for it before especially considering this is the first time I installed it.

Must be the other 1%. That is exactly the error I get when re-running mysql_secure_installation and just hitting after having set a password.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: MySQL Database is not letting me login for the first time with a blank password.

Postby kyrunner » 2012/05/01 22:46:38

jjrambo97 wrote:
kyrunner wrote:
Try this command

mysql_secure_installation

That is what I did initially...
1) /etc/init.d/mysql stop

2) mysqld_safe --skip-grant-tables &

3) mysql -u root

4) Setup new MySQL root user password
use mysql;
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
flush privileges;
quit

5) Stop MySQL Server: /etc/init.d/mysql stop

6) Start MySQL server and test it: mysql -u root -p
kyrunner
 
Posts: 30
Joined: 2011/09/26 16:34:22


Return to CentOS 6 - General Support

Who is online

Users browsing this forum: ngeorgop and 18 guests