Oracle 5.0 Reference Manual page 2981

Table of Contents

Advertisement

shell>
kill `cat /mysql-data-directory/host_name.pid`
Use backticks (not forward quotation marks) with the
to be substituted into the
cat
3. Create a text file containing the following statements. Replace the password with the password that
you want to use.
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
Write the
password for all
into memory so that it notices the password change.
4. Save the file. For this example, the file will be named /home/me/mysql-init. The file contains
the password, so it should not be saved where it can be read by other users. If you are not logged
in as
mysql
to read it.
mysql
5. Start the MySQL server with the special
shell>
mysqld_safe --init-file=/home/me/mysql-init &
The server executes the contents of the file named by the
changing each
6. After the server has started successfully, delete /home/me/mysql-init.
You should now be able to connect to the MySQL server as
server and restart it normally.
C.5.4.1.3. Resetting the Root Password: Generic Instructions
The preceding sections provide password-resetting instructions for Windows and Unix systems.
Alternatively, on any platform, you can set the new password using the
is less secure):
1. Stop
mysqld
connect without a password and with all privileges. Because this is insecure, you might want to use
--skip-grant-tables
clients from connecting.
2. Connect to the
shell>
mysql
3. Issue the following statements in the
you want to use.
mysql>
UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
->
mysql>
FLUSH PRIVILEGES;
The
FLUSH
password change.
You should now be able to connect to the MySQL server as
the server, then restart it normally (without the
networking
C.5.4.2. What to Do If MySQL Keeps Crashing
Administration-Related Issues
kill
and
statements each on a single line. The
UPDATE
FLUSH
accounts, and the
root
(the user the server runs as), make sure that the file has permissions that permit
account password.
root
and restart it with the
[420]
in conjunction with
server with this command:
mysqld
WHERE User='root';
statement tells the server to reload the grant tables into memory so that it notices the
[421]
options).
command. These cause the output of
cat
command.
statement tells the server to reload the grant tables
FLUSH
[409]
--init-file
--init-file
root
--skip-grant-tables
--skip-networking
client. Replace the password with the password that
mysql
root
--skip-grant-tables
2961
statement resets the
UPDATE
option:
[409]
option at startup,
using the new password. Stop the
client (but this approach
mysql
[420]
option. This enables anyone to
[421]
to prevent remote
using the new password. Stop
[420]
and
--skip-

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents