How to modify the default empty MySQL password in WAMP

Source: Internet
Author: User

InstallWAMPWhen,MySQLBy default, the password isEmpty PasswordThis is not conducive to the security of the server. We often change it to a password with high security. The modification method is actually very simple. Just run a few commands. Next I will perform the operation step by step.

First, open the mysql console through WAMP.

Prompt to enter the password. Because it is empty, press Enter.

Then, enter "use mysql", which means to use the mysql Database and prompt "Database changed.

Then enter the SQL statement "update user set password = PASSWORD ('hooray') where user = 'root';" for the password to be modified. Note that there must be no fewer semicolons at the end of the SQL statement, the prompt is OK.

Finally, enter "flush privileges;". If you do not enter this parameter, the password change operation will not take effect.

Enter "quit" to exit.

In addition, many people say that you can directly modify the password in the mysql table through phpmyadmin. The principle should be correct, but I found that the entire mysql database was lost after the modification, which caused me to reinstall WAMP, finally, it was modified through the command line.

For personal computers, you may think that modification is not important, but if it is a server, you still need to change the empty password, because it may be unsafe.

Here, we will introduce how to modify the MySQL Empty Password in WAMP. If you want to learn more about MySQL databases, the article here is just as brilliant: http://database.51cto.com/mysql /.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.