Other options may be necessary as well, depending on how you normally start your server. For example, --defaults-file  may be needed before the init_file  argument. 

6. After the server has started successfully, delete /home/me/mysql-init . 

You should now be able to connect to the MySQL server as root  using the new password. Stop the server and restart it normally. 

## Resetting the Root Password: Generic Instructions 

The preceding sections provide password-resetting instructions specifically for Windows and Unix and Unix-like systems. Alternatively, on any platform, you can reset the password using the mysql  client (but this approach is less secure): 

1. Stop the MySQL server if necessary, then restart it with the --skip-grant-tables  option. This enables anyone to connect without a password and with all privileges, and disables account- management statements such as ALTER USER  and SET PASSWORD . Because this is insecure, if the server is started with the --skip-grant-tables  option, it also disables remote connections by enabling skip_networking . 

2. Connect to the MySQL server using the mysql  client; no password is necessary because the server was started with --skip-grant-tables : 

shell> mysql 

3. In the mysql  client, tell the server to reload the grant tables so that account-management statements work: 

mysql> FLUSH PRIVILEGES; 

Then change the ’root’@’localhost’  account password. Replace the password with the password that you want to use. To change the password for a root  account with a different host name part, modify the instructions to use that host name. 

mysql> ALTER USER ’root’@’localhost’ IDENTIFIED BY ’MyNewPass’; 

You should now be able to connect to the MySQL server as root  using the new password. Stop the server and restart it normally (without the --skip-grant-tables  option and without enabling the skip_networking  system variable). 

## B.3.3.3 What to Do If MySQL Keeps Crashing 

Each MySQL version is tested on many platforms before it is released. This does not mean that there are no bugs in MySQL, but if there are bugs, they should be very few and can be hard to find. If you have a problem, it always helps if you try to find out exactly what crashes your system, because you have a much better chance of getting the problem fixed quickly. 

First, you should try to find out whether the problem is that the mysqld  server dies or whether your problem has to do with your client. You can check how long your mysqld  server has been up by executing mysqladmin version . If mysqld  has died and restarted, you may find the reason by looking in the server’s error log. See Section 5.4.2, “The Error Log” . 

On some systems, you can find in the error log a stack trace of where mysqld  died. Note that the variable values written in the error log may not always be 100% correct. 

Many unexpected server exits are caused by corrupted data files or index files. MySQL updates the files on disk with the write()  system call after every SQL statement and before the client is notified about the 

