LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 02-20-2006, 05:06 AM   #1
asheesh.tyagi
Member
 
Registered: Apr 2005
Location: Delhi,India
Distribution: Red Hat
Posts: 35

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


Hi

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, 06:24 AM   #2
onjoo
Member
 
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

Code:
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, 04:23 AM   #3
asheesh.tyagi
Member
 
Registered: Apr 2005
Location: Delhi,India
Distribution: Red Hat
Posts: 35

Original Poster
Rep: Reputation: 15
Hi
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, 10:55 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
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
Quote:
mysqladmin -u root password 'pass'
is incorrect too.
You're supposed to use either:
--password='some_passwd'
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.
 
  


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


All times are GMT -5. The time now is 02:47 PM.

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