-
Method one
1. Download the MySQL source distribution, do not differentiate the operating system, we need something is the same;
2. Rename your MySQL folder under the Data directory for OLDM Ysql
3. Copy the MySQL directory under the data directory in the source pack to your MySQL data directory;
4. Restart MySQL, now MySQL's licensing relationship with the new installation, empty password landing, and then adjust their authorization;
5. Open Oldmysql This library to check for problems in the end;
6. If there is a backup of the system in the central database integrity testing, so as not to be modified.
Method Two
1. Send Kill command to MYSQLD server to turn off MYSQLD server (not kill-9), and the file that holds the process ID is usually in the same directory as the MySQL database.
Kill ' Cat/mysql-data-directory/hostname.pid '
You must be the root user of Linux or an equivalent user on the server you are running to perform this operation;
Killall-term mysqld
2. Use the '--skip-grant-tables ' parameter to start the mysqld;
Shell>mysqld_safe--skip-grant-ta Bles
/bin/safe_mysqld--skip-grant-tables
3. Log on to hostname se using the ' mysql-h mysqld MySQL ' command RVer, change the password with grant command. You can also do this:
' mysqladmin-h hostname-u user password ' new password '
can actually also use
using MySQL; Update user Set Password =password (' Yourpass ') where user= ' root '
to do;
Shell>mysqladmin-u root flush-privileges password "newpassword"
>use mysql
>update user set P Assword=password ("New_pass") where user= "root";
>flush privileges;
4. Load permission table:
'
mysqladmin-h hostname flush-privileges '
or use SQL command
' flush privileges '
Of course, you can also restart mysqld here.