LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 05: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, 08: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, 08: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, 10: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 10:22 PM.
 
Old 05-30-2004, 10:51 PM   #5
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

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, 10: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, 10:57 PM   #7
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

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

TT
 
Old 05-31-2004, 12: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, 12:21 AM   #9
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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, 12:23 AM   #10
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

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, 12:24 AM   #11
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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, 01: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, 01:33 AM   #13
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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, 02: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, 03:07 AM   #15
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

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



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 03:31 PM
trouble logging in into Linux Redhat 6.0 irmwakimn Linux - Software 2 07-21-2004 08:52 AM
Trouble Logging in to mysql jevnin Linux - General 6 05-31-2004 12:23 AM
having trouble logging in paul62 Slackware 2 03-28-2004 06:52 AM
Logging out of X and into trouble LonnieB Linux - General 2 07-05-2003 07:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:14 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
Open Source Consulting | Domain Registration