In the manual ....
**** First off, have you tried the following ...
6.15 Causes of Access denied Errors
If you encounter Access denied errors when you try to connect to the MySQL
server, the list below indicates some courses of action you can take to
correct the problem:
After installing MySQL, did you run the mysql_install_db script to set up
the initial grant table contents? If not, do so. See section 6.12 Setting Up
the Initial MySQL Privileges. Test the initial privileges by executing this
command:
shell> mysql -u root test
The server should let you connect without error. You should also make sure
you have a file `user.MYD' in the MySQL database directory. Ordinarily, this
is `PATH/var/mysql/user.MYD', where PATH is the pathname to the MySQL
installation root.
After a fresh installation, you should connect to the server and set up your
users and their access permissions:
shell> mysql -u root mysql
The server should let you connect because the MySQL root user has no
password initially. That is also a security risk, so setting the root
password is something you should do while you're setting up your other MySQL
users. If you try to connect as root and get this error:
Access denied for user: '@unknown' to database mysql
this means that you don't have an entry in the user table with a User column
value of 'root' and that mysqld cannot resolve the hostname for your client.
In this case, you must restart the server with the --skip-grant-tables
option and edit your `/etc/hosts' or `\windows\hosts' file to add an entry
for your host.
**** If so, then do this ...
20.11 How to reset a forgotten password.
If you have forgotten the root user password for MySQL, you can restore it
with the following procedure.
Take down the mysqld server by sending a kill (not kill -9) to the mysqld
server. The pid is stored in a .pid file which is normally in the MySQL
database directory:
kill `cat /mysql-data-directory/hostname.pid`
You must be either the Unix root user or the same user the server runs as to
do this.
Restart mysqld with the --skip-grant-tables option.
Connect to the mysqld server with mysql -h hostname mysql and change the
password with a GRANT command. See section 7.34 GRANT and REVOKE syntax. You
can also do this with mysqladmin -h hostname -u user password 'new password'
Load the privilege tables with: mysqladmin -h hostname flush-privileges or
with the SQL command FLUSH PRIVILEGES.
Note that after you started mysqld with --skip-grant-tables, any usage of
GRANT commands will give you an Unknown command error until you have
executed FLUSH PRIVILEGES.
> -----Original Message-----
> From: AJ Hawks [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, 27 January 2001 19:01
> To: mySQL
> Subject: Locked out of mySQL.
>
>
> Hello,
> I'm trying to learn mysql & PHP. I recently set up the
> mysql server (with
> the file: mysql-3.23.32-pc-linux-gnu-i686.tar.gz)
>
> My problem is this: I either forgot the password, or neglected to
> set up any
> user accounts.
>
> The documentation says to do this:
> ./bin/mysqladmin -u root -p password 'new-password'
> ./bin/mysqladmin -u root -h twistedlogic -p password 'new-password'
>
> which returns the following:
>
> Enter password:
> ./bin/mysqladmin: connect to server at 'localhost' failed
> error: 'Access denied for user: 'root@localhost' (Using password: YES)'
>
> I also tried renaming the mysql directory (in /usr/local/) and
> re-installing
> it. no. maybe I did something wrong there, because that seems to me it
> should have worked, being a binary package... and the mysql table
> being held
> in mysql/data/mysql.
>
> anyway, if anyone knows how I can get back in.... tell me! :)
>
>
> thanks,
> AJ.
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php