LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-24-2011, 04:24 AM   #1
digsecurity
Member
 
Registered: Apr 2010
Posts: 54

Rep: Reputation: 18
Mysql root login problem


hi all,
I am having problem with mysql server in fedora14. It throws the following error whenever I try to connect with root user.
Quote:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
It shows the same error when I just press mysql. I even cant change the root password. But I am able to login with other user.
 
Old 06-24-2011, 07:17 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
If
Code:
mysql_secure_installation
was executed, "You can remove root accounts that are accessible from outside the local host."

So, if you're trying to access a remote machine, that's the problem (you can't).

Otherwise, either (1) there is no password set (so don't use -p on the command line) or (2) you don't have the correct password.

If you can connect to the mysql data base, e.g., "use mysql," try
Code:
mysql> select host, user, password from user;
and see what you get -- a system without a root password will look like this
Code:
mysql> select host, user, password from user;
+-----------+--------+-------------------------------------------+
| host      | user   | password                                  |
+-----------+--------+-------------------------------------------+
| localhost | root   |                                           |
| fubar     | root   |                                           |
| 127.0.0.1 | root   |                                           |
| localhost |        |                                           |
| fubar     |        |                                           |
| localhost | trona  | *3E473C392738635BB3C40B77F339AE2B5B96AB5F |
| %         | trona  | *3E473C392738635BB3C40B77F339AE2B5B96AB5F |
| localhost | gnis   | *810EB1988696641613BC905C437D48DB0286A594 |
| %         | gnis   | *810EB1988696641613BC905C437D48DB0286A594 |
| localhost | bugs   | *20F70E9EB731F79D181E637A46E64D7E1050F956 |
| %         | bugs   | *20F70E9EB731F79D181E637A46E64D7E1050F956 |
| localhost | ged    | *4CA8F8F4B8B5DCC12808D5AE020BCCB3E522CCA6 |
| %         | ged    | *4CA8F8F4B8B5DCC12808D5AE020BCCB3E522CCA6 |
| localhost | ipplan | *EDA2B4CA7C3B7D3287C8DB2EA4850DFB25D9ED41 |
| %         | ipplan | *EDA2B4CA7C3B7D3287C8DB2EA4850DFB25D9ED41 |
+-----------+--------+-------------------------------------------+
15 rows in set (0.00 sec)
whereas a system with a root password will look like this
Code:
mysql> select host, user, password from user;
+-----------+--------+-------------------------------------------+
| host      | user   | password                                  |
+-----------+--------+-------------------------------------------+
| localhost | root   | *3E473C392738635BB3C40B77F339AE2B5B96AB5F |
| 127.0.0.1 | root   | *3E473C392738635BB3C40B77F339AE2B5B96AB5F |
| localhost | trona  | *3E473C392738635BB3C40B77F339AE2B5B96AB5F |
| %         | trona  | *3E473C392738635BB3C40B77F339AE2B5B96AB5F |
| localhost | gnis   | *810EB1988696641613BC905C437D48DB0286A594 |
| %         | gnis   | *810EB1988696641613BC905C437D48DB0286A594 |
| localhost | bugs   | *20F70E9EB731F79D181E637A46E64D7E1050F956 |
| %         | bugs   | *20F70E9EB731F79D181E637A46E64D7E1050F956 |
| localhost | ged    | *4CA8F8F4B8B5DCC12808D5AE020BCCB3E522CCA6 |
| %         | ged    | *4CA8F8F4B8B5DCC12808D5AE020BCCB3E522CCA6 |
| localhost | ipplan | *EDA2B4CA7C3B7D3287C8DB2EA4850DFB25D9ED41 |
| %         | ipplan | *EDA2B4CA7C3B7D3287C8DB2EA4850DFB25D9ED41 |
+-----------+--------+-------------------------------------------+
12 rows in set (0.00 sec)
Hope this helps some.
 
Old 06-24-2011, 08:07 AM   #3
sandwormusmc
Member
 
Registered: Nov 2006
Distribution: Fedora 15 x86_64
Posts: 76

Rep: Reputation: 24
Quote:
Originally Posted by digsecurity View Post
hi all,
I am having problem with mysql server in fedora14. It throws the following error whenever I try to connect with root user.


It shows the same error when I just press mysql. I even cant change the root password. But I am able to login with other user.
If you have root on the box, shutdown mysql with a "service mysqld stop", then run mysql --skip-grant-tables. That will get you in and allow you to change the root password.

Good luck!
 
Old 06-25-2011, 11:29 PM   #4
digsecurity
Member
 
Registered: Apr 2010
Posts: 54

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by tronayne View Post

Otherwise, either (1) there is no password set (so don't use -p on the command line) or (2) you don't have the correct password.
Yea, (2) was right. I was just typing the wrong password and thinking of some serious problem. I am really sorry for taking your time but this really helped me to remember that I had changed my root password.

Thank You
 
  


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
mysql: still can't login after root password reset andredude Linux - Software 4 12-19-2014 06:30 PM
Slackware 12.1 MySQL doesn't allow root login alienDog Slackware 2 07-09-2008 09:38 AM
MySQL root login problem AnRkey Linux - Software 2 05-10-2006 05:31 AM
Big problem changed root password for mysql can't login pls comment johnnydangerous Linux - Software 5 07-08-2005 01:22 AM
Mysql Root Login SilentK Linux - Newbie 11 08-14-2004 12:54 PM

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

All times are GMT -5. The time now is 10:39 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