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]



Reply via email to