Speaking of the root password, many people think of the root password of the computer system, in fact, mysql also has a root password, then in the Linux system, how to modify the root password in mysql? Especially what should I do if I forget the root password?
mysql by logging systems:
code is as follows
# mysql -uroot -p
Enter password: Enter the old password] [< Br>
mysql"use mysql;
mysql" update user set password=passworD(“test”) where user=’root’;
mysql "flush privileges;< Br>
mysql" exit;
Outside the mysql system, use mysqladmin:
The code is as follows
# mysqladmin -u root -p password “test123″< Br>
Enter password: [Enter the original password]
Forget the password of the original myql root:
First of all, you must have the root privileges of the operating system. If you do not have the root privileges of the system, first consider the root system and then follow the steps below.
Similar to the safe mode login system, it is recommended to say pkill mysql, but I do not recommend it. Because when you execute this command, it will lead to such a situation:
The code is as follows
/etc/init.d/mysqld status
mysqld dead but subsys locked< Br>
So even if you start mysql in safe mode, it may not be useful, so it is generally /etc/init.d/mysqld stop, if you unfortunately use pkill first, then start and then stop .
Code is as follows
# mysqld_safe –skip-grant-tables &
&, means running in the background, no longer running in the background, then open a terminal Oops.
Code is as follows
# mysql
mysql use mysql;
mysql UPDATE user SET password=password(“test123“) WHERE user= ’root‘;
mysql "flush privileges;
mysql" exit;
## Originally mysql is not case-sensitive, but this is modified mysql The specific value of the mysql database should be noted.
The above is the introduction of Linux to change the root password of myaql, this article also details the mysql forget the root password modification method, I hope to help you.
When using a computer, we hope to recover important files that have been accidental
CentOS has just been updated to CentOS7 in recent days, so many users do not know how to install and
Ubuntu sometimes need to modify the command prompt PS1 when using the command, but many people do no
Unix system can uninstall the installed program through the command, but there are problems when the
Steps to install arping on Fedora 18
How to quickly switch the old server IP to the new server under Linux
How Linux limits user login failures through PAM
How to achieve multi-threaded programming under Linux shell
RedHat software source prompt Unable to read consumer identity?
Linux changes the way Docker runs the root directory
Linux system settings DB2 and other services boot process
Solution for adb connection failure under Mac or Linux
Linux backup method through shell script
Linux ln command operation guide
How to modify the color of the Linux system shell script output text
How to delete the micro cloud network disk icon in Win7 system?
How to open the Win8 command prompt? Win8 open command prompt method
Create Hyper-V for virtual machine running environment in Win8
Win7 system "devices and printers" two major functions
Combine multiple Win 7 themed wallpapers together
Win8 installation Chinese software garbled how to do
Teach you why you must press F1 to boot into the system
Let Windows 8 be more like the Windows 7 method
Windows8 exits to clear the dynamic tile expiration notification