LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-07-2004, 11:01 AM   #1
mikz
Member
 
Registered: Sep 2004
Distribution: Slackware current
Posts: 109

Rep: Reputation: 15
MySQL Passwords


I've installed MySQL on my Slackware OS. I've figured out that how to set the password for the mysql root user. (/usr/bin/mysqladmin -u root password 'new-password').

My question is what is meant by the following syntax.?

/usr/bin/mysqladmin -u root -h localhost password 'new-password'

Do I also have to give localhost a password.? I've tried typing it and receive the following error message:

bash-2.05b# /usr/bin/mysqladmin -u root -h localhost password 'new-password'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

Any comments?
 
Old 09-07-2004, 12:30 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Check the man pages for mysqlaccess. You may be able to fix the problem with mysqlaccess. After that, check the mand pages for mysqld to learn how to verify that the mysql server is running.
 
Old 09-07-2004, 12:39 PM   #3
scissors
Member
 
Registered: Aug 2004
Location: Seattle
Distribution: Red Hat es and as, Solaris, Fedora, Debian, Tru64
Posts: 45

Rep: Reputation: 15
This means that you want to set a new password for the database user root to new-password on the host localhost. I would guess that if you already set a password then you will need to include the -p flag so that it will prompt for you to enter a password (the one you already assigned). That is what I get from the access denied error.

The failure to connect to server part makes me believe that your mysqld is not running. Try starting the database first. Also try 'man mysqladmin' you can also check out the documentation on the mysql website, it is fairly comprehensive.
 
Old 09-07-2004, 12:46 PM   #4
Boby
Member
 
Registered: Feb 2004
Posts: 781

Rep: Reputation: Disabled
Hello!

mysqladmin -u root -h localhost password 'new-password'

this means: start mysqladmin [where you set your adminstrators password for mysql] with "-u root" [username root] , "-h localhost" [hostname localhost, thats' your computer name] and "password 'new-password'" [root's password 'new-pasword', this will be your password]

-u = username
-h = hostname
password = password

You don't have to write "-h localhost" only if it's something else. Then start mysql with:
mysql -u username -p password

Hope you understood!
Boby
 
Old 09-07-2004, 02:39 PM   #5
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
There should be no space between the -p and the password.
 
  


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 doesn't like passwords legendaryfox Linux - Software 12 03-09-2009 04:36 PM
MySQL problem - can't use passwords Ook Slackware 4 04-23-2005 06:36 PM
Sync MySQL passwords with local account passwords? turbine216 Linux - Software 2 02-18-2005 03:15 AM
Completely uninstalling MySQL and its passwords passwords...how? I locked myself out! Baix Linux - Newbie 2 01-30-2005 04:10 PM
MySQL root passwords ridertech Linux - Software 4 05-11-2004 10:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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