What if you forget the root password of the online MySQL database one day? 1. Close the MySQL database. mysqladmin cannot use the root password because it is forgotten. In this case, killpid can only be used to close the program. What if you forget
First we want to enter your MySQL server, use net stop mysql to stop MySQL, and then run the DOS command, enter CMD in the run, and then switch to the MySQL bin directory, run the command:
The code is as follows
Copy Code
Solutions
Method One
1. Stop MySQL Service
Start-> run cmd, enter net stop MySQL at the command prompt window
2, switch the current directory to the MySQL installation path under the Bin directory
such as: CD C:mysql5bin
3, set no password
About How to modify the MySQL tutorial root password We have listed a lot of changes on the mysql password , okay crap don't say much more we look at these days to modify the root password effective means and methods.Method One
Using the PHP
I'll take a few examples and I'm sure I'll get it soon.1, the original password is 123456C:>type Mysql5.bat@echo offmysql-uroot-p123456-p3306The correct format for modifying the MySQL user password is:We use it here.User: root (can be replaced by
First with the root account login phpMyAdmin, and then click on the left to enter the MySQL database, at the top of the click "MySQL" into the SQL input interface. Enter the following command:
The code is as follows
Copy Code
One: (Stop running MySQL)
The code is as follows
Copy Code
[Root@netdakvps ~]# service mysqld Stop
Two: Restart MySQL using the "--skip-grant-tables" parameter
The code is as follows
Copy Code
Login to the MySQL system:
code is as follows
copy code
# mysql-uroot-p Enter Password: " Enter the original password Mysql> use MySQL; mysql> Update user set Password=password ("test")
@echo off title MySQL:: Find the MySQL installation path from the registry write file Mysql.txt reg Query Hklm\system\controlset001\services\mysql | find/i "ImagePath" >c:\mysql.txt if%errorlevel% neq 0 (echo mysql not found pause exit):: With "as
1. First verify that the server is in a secure state, that is, no one can connect to the MySQL database arbitrarily.Because the MySQL database is completely password-protected during the reset of the root password of MySQLStatus, other users can
1: Go to cmd, stop MySQL service: Net stop MySQL (enter service---->mysql-----> Stop) to MySQL installation path to start MySQL, Use Mysqld-nt.exe boot in bin directory, 2: Execute: Mysqld-nt--skip-grant-tables (window will stop) 3: Then open
The root password is missing and we need to restart MySQL in a way that does not check permissions.In the MySQL configuration file (/etc/my.cnf), add a skip-grant-tables under [mysqld] and restart the service to log in without a password.Through
Small partners to install a code version control software on the previous server, to use the database, but want to find the root password or forget, other installed services are used in the private account configuration file to find the root user's
Official information: Http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unixThere is also a reference to MySQL installation, with Python-mysql installation blog http://hearrain.com/2011/01/498According to
Phpmyadmin is a WEB-based mysql database management tool that can perform various operations on the mysql database. However, you must configure the username and logon password in phpmyadmin, if the mysql password is changed, the password in
Vim/etc/my. cnf add skip-grant-tables/Etc/init. d/mysqld restartMysqlUse mysqlUpdate user set password = password ("XMY_vI105VxV") where user = "root ";Flush privileges;Exit/Etc/init. d/mysqld restartWin is to modify my. ini, and the same Restart
Mysql root forgot, now unable to operate the database to stop mysql service servicemysqlstop or ps-ef | grepmysql | xargskill-9 and then start mysql with the following parameters, -- skip-grant-tables skips mysql authorization shell #/usr/bin/mysqld_
In this case, the root password of MySQL is lost. To restore it, let's talk about the environment first:
Red Hat Enterprise Linux 6.3 x86_64
MySQL 5.5.28
According to your previous experience, modify my. cnf: Add skip-grant-tables in [mysqld],
One of the simplest methods to restore the root password of MySQL:
Set password for 'root' @ 'localhost' = PASSWORD ('123 ');
Put the above file! Statement is SQL .txt
Stored in any folder
I am storing it in E:/sevser /.
Run
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.