LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trouble Logging in to mysql (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-logging-in-to-mysql-187769/)

jevnin 05-30-2004 05:21 PM

Trouble Logging in to mysql
 
I continuously get this error when trying to log in to mysql:

[mythtv@localhost sbin]$ mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

If I leave off the -p, I get a similar error:

[mythtv@localhost sbin]$ mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

I do this after using 'su' to get into my root account. I get the same errors when I actually log in to root. Any suggestions? Thanks!

-j

Rico16135 05-30-2004 08:33 PM

and you're sure you're typing in the correct password, right?

jevnin 05-30-2004 08:56 PM

Yep, the password i'm typing is correct. I've tried all possibilities.

Rico16135 05-30-2004 10:21 PM

is root the only user for your databases? I'm trying to find some more info online for ya. Post back up if I find anything. Is there sensitive information in your database right now?

Remember the password is case sensitive.

tommytomato 05-30-2004 10:51 PM

have you tried setting the root password for MySQL ?

mysqladmin -u root -p password 'your_new_password'


TT

Rico16135 05-30-2004 10:55 PM

-tommy-

great call, I just assumed he'd gotten past that point.
any luck with that Jevnin?

tommytomato 05-30-2004 10:57 PM

what you mean, any luck with that Jesmin?

TT

jevnin 05-31-2004 12:10 AM

Still not working... :-(

[root@localhost mythtv]# mysqladmin -u root -p password 'josh'
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'

There is no sensitive information in my database now. In fact, if I can just wipe out all the mysql settings and just start over I'll be happy...but I don't want to reinstall linux!

trickykid 05-31-2004 12:21 AM

Okay, I just now noticed this and its a double post. Which one you want to close, the one here or the one in Linux - General as your breaking our rules you agreed to when registering? Let me refresh your mind:

http://www.linuxquestions.org/rules.php

Let me know so I can either report this one or close the other one where I found your solution most likely.

tommytomato 05-31-2004 12:23 AM

did you set this on as well ?
mysqladmin -u root -h localhost password 'new-password'

is mysql on ? if not do a ( chkconfig mysql on )
then /etc/init.d/mysql start

check status

/etc/init.d/mysql status

easy one but its for droping databases only.

mysqladmin -u root -p drop name_of_database

Sample below

mysqladmin -u root -p drop nuke

TT

trickykid 05-31-2004 12:24 AM

Nevermind, I didn't feel like waiting so I closed the other thread.

The solution is to put single quotes around your password:

mysql -uroot -p'password'

And that should log you in since without quotes, it doesn't like the ) in your password. And don't cross post in the future please, its uncalled for and unecessary.

jevnin 05-31-2004 01:18 AM

sorry for cross-posting...didn't read the rules close enough, will be more careful in the future.
-j

trickykid 05-31-2004 01:33 AM

Quote:

Originally posted by jevnin
sorry for cross-posting...didn't read the rules close enough, will be more careful in the future.
-j

Nevermind that now, did the single quotes work at all? :)

lamedavis 06-04-2004 02:56 AM

I am having a similar problem....it seems that if I set a password for the root account the mysqld will not start when the server is turned on. if I remove the password then mysqld will start, but that creates a security issue for my becasue im trying to incorporate phpmyadmin aswell, which needs to be installed in the documnet root, so there needs to be a password set.. what am I doing wrong?

thanks in advance,

Jeremy

tommytomato 06-04-2004 03:07 AM

Hi mate

I found that i also could set the root password etc using phpmyadmin

look under settings or perms forgotton what it was, haven't got the other PC up at this stage.

TT


All times are GMT -5. The time now is 09:36 PM.