Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-20-2006, 04:06 AM   #1
Registered: Apr 2005
Location: Delhi,India
Distribution: Red Hat
Posts: 35

Rep: Reputation: 15
mysql root privilages lost automaticaly on a database


I have installed Mysql 4.1 on fedora core 4.
after starting mysqld for first time ,i set root password using
mysqladmin -u root password 'pass'
after this i was able to do every thing after loging using
mysql -u root -p
but now when i login using the same command and i issue tke command
show databases;
it shows only test database, not the mysql database.
when i isue command
use mysql;
it gives me error
access denied for user root@localhost on database mysql;
Please help me in finding out why this happen.

Thanks & Regards
Ashish tyagi
Old 02-20-2006, 05:24 AM   #2
Registered: Jan 2005
Location: Finland
Distribution: Suse 10, Suse-factory , RHEL4, SLES9, SLED10
Posts: 380

Rep: Reputation: 30
My comes here...

Are you sure that the mysql-database has been created in the install procedure.
If it isn't , you will need to create it with

mysql_install_db --user=mysql
Second solution that comes to my mind, is the user right for the folder, where MySQL stores its data. Maybe the MySQL-user group is missing?
Check if user and group have correct right to that folder. In suse its /var/lib/mysql
Old 02-21-2006, 03:23 AM   #3
Registered: Apr 2005
Location: Delhi,India
Distribution: Red Hat
Posts: 35

Original Poster
Rep: Reputation: 15
mysql database was created at the time of installation and i was able to use it.
I have checked folder permissions of /var/lib/mysql it belongs to mysql. and permissions are
755 mysql mysql
Old 02-21-2006, 09:55 AM   #4
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
mysql -u root -p
Don't you need to supply the password for MySql's root user too?

You can also add "-D database_name" to directly start using one of the databases.

Furthermore, I think your syntax in
mysqladmin -u root password 'pass'
is incorrect too.
You're supposed to use either:
or -p 'some_passwd'
where you need to replace 'some_passwd' with the actual password, of course.
Don't mix the 2 syntaxes, otherwise it may still work, but it won't do what you are trying to accomplish.


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
mysql root password lost nazir Linux - Software 6 10-09-2007 10:18 AM
Is there anyway to connect to the internet without root privilages? captainfreedom Linux - Newbie 2 02-28-2005 10:59 AM
root privilages cheech66 Linux - Newbie 7 05-31-2004 08:09 AM
Root User Privilages Jonlinuxuser Linux - Software 1 05-17-2004 06:58 PM
NTFS drive - no user privilages - root only jon_k Linux - Software 2 09-01-2003 05:28 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 PM.

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