Home Database Mysql Tutorial Linux MySQL密码修改_MySQL

Linux MySQL密码修改_MySQL

Jun 01, 2016 pm 01:32 PM
change Password change Password forget the password number

bitsCN.com

Linux MySQL密码修改

 

1)如果您没有忘记密码的情况下,可以通过UPDATE直接编辑user表来修改密码:

进入数据库mysql -u root

mysql> use mysql;

mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';

mysql> FLUSH PRIVILEGES;

或者 

 /etc/init.d/mysql stop 

 /etc/init.d/mysql start

 

2)如果您已经忘记密码:

# /etc/init.d/mysql stop                                   1、结束当前正在运行的mysql进程。

# /usr/bin/mysqld_safe --skip-grant-tables     2、用mysql安全模式运行并跳过权限验证。

# mysql -u root                                               3、重开一个终端以root身份登录mysql。

 

 

mysql> use mysql;                                          4、修改root用户口令。

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

 

Database changed

mysql> update user set Password = PASSWORD('root') where User ='root';

Query OK, 3 rows affected (0.00 sec)

Rows matched: 3 Changed: 3 Warnings: 0

 

 

mysql> exit

 

 

# /etc/init.d/mysql restart                                5、结束mysql安全模式,用正常模式运行mysql。

mysql> update mysql.user set password=PASSWORD('新密码') where User='root'; 

                                                                       6、试试你新修改的口令

mysql> flush privileges;

mysql> quit

 

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to reset password and unlock screen on vivo X60 Pro? How to reset password and unlock screen on vivo X60 Pro? Jan 05, 2024 pm 08:02 PM

The lock screen password of a mobile phone is an important means of protecting personal privacy, and its importance is self-evident. Although smartphones now support fingerprint unlocking and face recognition unlocking, you still need to enter the lock screen password every time you turn on the phone, and fingerprint recognition may occasionally fail. What should you do if you unfortunately forget your lock screen password? The following is a tutorial for unlocking vivoX60Pro after forgetting the password. VivoX60Pro Forgot Password Unlocking Tutorial When you enter the wrong lock screen password five times in a row on vivoX60Pro, the phone will automatically lock. If you forget your password, the only solution is to reset it. The following is a detailed tutorial on resetting the lock screen password on vivoX60Pro. One way to reset your lock screen password is through a security question. This is

How to unlock the phone if I forget the password on my Apple phone How to unlock the phone if I forget the password on my Apple phone Mar 08, 2024 pm 02:46 PM

Forgetting the lock screen password of your Apple phone is a common problem, but it is also an annoying thing. If you encounter this problem, don’t worry because there are many ways to help you unlock your iPhone. Below we will introduce you four simple methods to unlock iPhone lock screen. How to unlock the iPhone if you have forgotten the password. Method 1: Use the "Forgot Password" function. If you forget the iPhone lock screen password, you do not need to reset the phone or use iTunes to restore it. In the latest version of iOS, there is a "regret medicine" function that can help you reset your password. When you enter the wrong password multiple times in a row, it will enter security lock mode. In this mode, you can select "Forgot Password" and then enter your

What to do if you forget your oppo password 'Must-see: Oppo mobile phone forgotten password recovery tutorial' What to do if you forget your oppo password 'Must-see: Oppo mobile phone forgotten password recovery tutorial' Feb 07, 2024 pm 04:18 PM

As a necessity in today's life, mobile phones must be in many people's bags. In order to ensure the safety of the mobile phone, some friends will set a password when using it. It is precisely because of this that some people forget the password. Let’s take the Oppo mobile phone as an example and let’s see how to unlock the Oppo mobile phone if you forget the password. How to Unlock an Oppo Phone If You Forgot the Password? It is not uncommon to encounter the situation of forgetting the password on an Oppo phone. Fortunately, there are many solutions. One of the commonly used methods is to solve the problem through the [Desktop] - [Cloud Service] - [Retrieve Phone] function on the mobile phone. Just turn on the switch to retrieve your password. In addition, you can also log in to the cloud service webpage through your mobile phone or computer and enter your account password to solve this problem. No matter which method,

How to change the password of Amap_How to change the password of Amap How to change the password of Amap_How to change the password of Amap Apr 01, 2024 pm 01:56 PM

1. First find [Amap] on your mobile phone and open it. 2. Then switch to the [My] tab and click the settings icon in the upper right corner to enter. 3. Click [Account and Security] to enter. 4. Then click [Login Password] to enter. 5. Finally enter the password and click [Confirm Modification] to complete.

How to change password on Xiaomi door lock_Tutorial on changing password on Xiaomi door lock How to change password on Xiaomi door lock_Tutorial on changing password on Xiaomi door lock Mar 25, 2024 am 11:40 AM

1. Open the Mijia app on your phone and click Mijia Smart Door Lock. 2. Verify the security password through numbers, fingerprints or faces. 3. Select the user whose password needs to be changed. 4. You can delete the user and then add the user to set a new password, or you can add a new password directly.

How to unlock Meizu v8 phone if you forget the password 'Recommended solution for Meizu phone that cannot remember password' How to unlock Meizu v8 phone if you forget the password 'Recommended solution for Meizu phone that cannot remember password' Feb 07, 2024 pm 06:27 PM

Meizu mobile phones are used by many domestic users, mainly because they are relatively cheap and have many functions. The key is that they take beautiful photos. They are basically on par with domestic low-end mobile phones such as Xiaomi and Oppo. If you forget the password of Meizu mobile phone, How to do it? How to unlock it? Today, Zhu Yan from Honey Pot Ant Decoration Network will introduce to you what to do if you forget the unlock password of Meizu mobile phone. I hope it will be useful to everyone. 1. Password reset through Meizu’s official flyme. For users who have not set up flyme security, you can use this method to reset the phone unlock password. The method is also relatively simple. First, remove the mobile phone card from the phone that forgot the unlock password. Take it out and put it in another mobile phone; secondly, enter Meizu official click to log in now, and then enter

What to do if you forget your win10 username and password What to do if you forget your win10 username and password Feb 15, 2024 pm 04:54 PM

When you set a password for your computer, you may forget your computer startup password for various reasons. What should you do if you forget your password in the latest Windows 10 system? Here is a sharing for all of you, let’s take a look at the solution after forgetting the power-on password and how to force a reset. Practical steps: 1. Click the [Computer] icon in the lower right corner of the startup interface, and the power options will pop up. At this time, hold down the [Shift] key and click [Restart] with the mouse to enter the Windows startup settings menu. 2. Select [Troubleshoot] in the pop-up Windows settings menu interface to reset your computer or view advanced options. 3. Select [Reset this PC] on the troubleshooting interface to allow you to choose to keep personal files or delete personal files.

How to reset the password on your Apple phone? How to reset the password on your Apple phone? Feb 19, 2024 am 08:31 AM

What to do if you forget your iPhone password. With the popularity of smartphones, mobile phones have become an indispensable part of our lives. As one of the mobile phone brands with a high market share, Apple mobile phones are also deeply loved by users. However, with the continuous enhancement of mobile phone functions, we often set complex passwords to protect the privacy of mobile phones, but this also brings a problem, what should we do if we forget the password? First of all, when we realize that we have forgotten our mobile phone password, we should try to stay calm. Because anxiety and panic will only make the problem worse

See all articles