LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-08-2007, 11:04 AM   #1
madhavr
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora 6
Posts: 10

Rep: Reputation: 0
mysql inital setup issue


hi ive just installed mysql on fc6 and im getting the following issue

Quote:
[root@localhost ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ive tried setting the root password and i still get the same message as above
 
Old 05-08-2007, 11:16 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
Is it even prompting for the password?

mysql -u root -p mysql
 
Old 05-08-2007, 11:32 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Try "mysql -u root -p"
It should as for the password then. I think that is to prevent the entering of the root password on the command line, which a user might be able to see looking at the process.

I take it back.
"mysql -u root -p password" won't work, whereas "mysql -u root -ppassword" will.

mysql changes the password argument to hide it, so if you enter the password on the command line, the risk is if someone can print out the cmdline before it is changed.
Code:
cat /proc/28991/cmdline
mysql-uroot-pxxxxxxx
Look in /usr/share/doc/packages/mysql/manual.pdf or manual.ps. There is a chapter on securing mysql after installation.

Last edited by jschiwal; 05-08-2007 at 11:38 AM.
 
Old 05-08-2007, 11:51 AM   #4
madhavr
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora 6
Posts: 10

Original Poster
Rep: Reputation: 0
hi trickykid it worked i was able to login finally using -p mysql which makes no sense to me as i didnt set this to be the password.

I suspect this might have something to do with this package version being custom to fc6?? as it did say that in the version. however didnt see anything in the docs that pointed out that root was already setup since after installation you get the normal mysql_istall_db spew instructions on setting up the root password etc

Last edited by madhavr; 05-08-2007 at 12:06 PM.
 
Old 05-08-2007, 12:14 PM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
-p mysql is setting the default database to login and use so you don't have to switch databases after logging in. In all cases there's a mysql database on every mysql install. It's just out of habit that I use that to login for the first time cause I'll be making changes to the mysql database.

If you want to specify the password from the command you can do:

mysql -u <username> -p<password> # Notice there is no space after -p

or

mysql -u <username> -p <database> --password=<password>

For security reasons, probably best to make it prompt for the password by just passing a -p.
 
Old 05-08-2007, 12:30 PM   #6
madhavr
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora 6
Posts: 10

Original Poster
Rep: Reputation: 0
thanks for your help trickykid (again) it seems to work fine now and i've assigned password to root using SET PASSWORD command with no issues.
 
  


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
Buzilla issue: "Can't connect to local MySQL server through socket '/tmp/mysql.sock'" vitopn Linux - General 3 05-21-2007 10:13 AM
What do two forward slashes in a url mean? (not the inital 2) johnMG Linux - Networking 2 06-28-2005 10:27 AM
Inital install for email server cadkins Slackware 4 10-25-2004 07:14 PM
Inital problems with squid colabus Linux - Newbie 1 08-04-2004 10:42 AM
MySQL setup stops at command "./configure --prefix=/usr/local/mysql" k41184 Linux - Software 1 05-20-2004 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration