LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 05-30-2004, 06:21 PM   #1
jevnin
LQ Newbie
 
Registered: May 2004
Distribution: Fedora Core 2
Posts: 8

Rep: Reputation: 0
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
 
Old 05-30-2004, 09:33 PM   #2
Rico16135
Member
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Slackware 9.1, SuSE 9.1
Posts: 245

Rep: Reputation: 30
and you're sure you're typing in the correct password, right?
 
Old 05-30-2004, 09:56 PM   #3
jevnin
LQ Newbie
 
Registered: May 2004
Distribution: Fedora Core 2
Posts: 8

Original Poster
Rep: Reputation: 0
Yep, the password i'm typing is correct. I've tried all possibilities.
 
Old 05-30-2004, 11:21 PM   #4
Rico16135
Member
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Slackware 9.1, SuSE 9.1
Posts: 245

Rep: Reputation: 30
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.

Last edited by Rico16135; 05-30-2004 at 11:22 PM.
 
Old 05-30-2004, 11:51 PM   #5
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Rep: Reputation: 32
have you tried setting the root password for MySQL ?

mysqladmin -u root -p password 'your_new_password'


TT
 
Old 05-30-2004, 11:55 PM   #6
Rico16135
Member
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Slackware 9.1, SuSE 9.1
Posts: 245

Rep: Reputation: 30
-tommy-

great call, I just assumed he'd gotten past that point.
any luck with that Jevnin?
 
Old 05-30-2004, 11:57 PM   #7
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Rep: Reputation: 32
what you mean, any luck with that Jesmin?

TT
 
Old 05-31-2004, 01:10 AM   #8
jevnin
LQ Newbie
 
Registered: May 2004
Distribution: Fedora Core 2
Posts: 8

Original Poster
Rep: Reputation: 0
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!
 
Old 05-31-2004, 01:21 AM   #9
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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.
 
Old 05-31-2004, 01:23 AM   #10
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Rep: Reputation: 32
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
 
Old 05-31-2004, 01:24 AM   #11
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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.
 
Old 05-31-2004, 02:18 AM   #12
jevnin
LQ Newbie
 
Registered: May 2004
Distribution: Fedora Core 2
Posts: 8

Original Poster
Rep: Reputation: 0
sorry for cross-posting...didn't read the rules close enough, will be more careful in the future.
-j
 
Old 05-31-2004, 02:33 AM   #13
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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?
 
Old 06-04-2004, 03:56 AM   #14
lamedavis
Member
 
Registered: Jan 2004
Location: Ashland, Oregon
Distribution: Fedora Core 1 & 2
Posts: 51

Rep: Reputation: 15
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
 
Old 06-04-2004, 04:07 AM   #15
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Rep: Reputation: 32
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble logging in spartn119 Slackware 11 12-14-2004 04:31 PM
trouble logging in into Linux Redhat 6.0 irmwakimn Linux - Software 2 07-21-2004 09:52 AM
Trouble Logging in to mysql jevnin Linux - General 6 05-31-2004 01:23 AM
having trouble logging in paul62 Slackware 2 03-28-2004 07:52 AM
Logging out of X and into trouble LonnieB Linux - General 2 07-05-2003 08:31 AM


All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration