mysqladmin isn't interactive -- it expects a command to process. With no command, mysqladmin prints a help message then quits. It doesn't need a password for that.

For example, to tell the mysql server to shut down, you enter

mysqladmin -u root -p shutdown

You should be prompted for the password, then mysqld will exit.

See <http://www.mysql.com/doc/en/mysqladmin.html> for more.

Michael

Ralph McCarthy wrote:

Michael:

You were correct. My problem was that I had set a password for mysql but didn't realize that I had successfully done so (newbie confusion). I can now create a database. Unfortunately, there is an additional issue: it appears as though I didn't set a password for mysqladmin (or I did so inadvertently and am unaware of what that password is) because when I type the following at the prompt:

mysqladmin -u root -p

MySQLAdmin seems to start up without asking for my password:

/usr/local/mysql/bin/mysqladmin Ver 8.40 Distrib 4.0.17, for apple-darwin6.8 on powerpc
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
...


Shouldn't it request my password? Perhaps this just means that I did set the password for both mysql and mysqladmin after installation. What should I do?

Thanks for your help.

Ralph


On Wednesday, January 7, 2004, at 01:24 PM, Michael Stassen wrote:



Ralph McCarthy wrote:


Hi:
I've just installed MySQL on Mac OS X 10.2.8. I'm unable to create a database. When I try to do so, I get the following error message:


I have the same setup.

mysql> CREATE DATABASE MYDATABASE;
ERROR 1044: Access denied for user: '@localhost' to database 'mydatabase'


See #3 below.

I suspect that the problem may be that I never set the password for mysqladmin correctly (perhaps I didn't set it at all).
When I attempt to set it using this command:
mysqladmin -u root -h localhost password <password>
I get this message:
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: '[EMAIL PROTECTED]' (Using password: NO)'


See #1 below.

Please help. Thanks in advance.
Ralph


1) The command

mysqladmin -u root -h localhost password <password>

fails because [EMAIL PROTECTED] already has a password which you didn't supply. I expect this is because you've already run

mysqladmin -u root password <password>

to set the password. Once [EMAIL PROTECTED] has a password, you need to run mysqladmin like this:

mysqladmin -u root -p <command>

The -p indicates you need to suppply the password, so you'll be prompted for it.

2) If you don't know what you set as the password for [EMAIL PROTECTED], see <http://www.mysql.com/doc/en/Resetting_permissions.html>.

3) The error message indicates you are logged in as the anonymous user (username = '') who has no rights (except to the test db). You probably tried just `mysql`. Instead, you should use

mysql -u root -p

to indicate you wish to log in as [EMAIL PROTECTED] and be prompted for the password. Once logged in, you might want to get rid of the anonymous user, and set yourself up as a normal user.

Michael


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to