How to change the default password of MySQL

Source: Internet
Author: User
Tags password protection
After MySQL is installed on windows, the system generates a license table and an account by default, you do not need to execute the mysql_install_db script on the Unix platform to generate an account and the corresponding permission table. However, if you do not use the MSI format to install MySQL, You need to manually add a new password to the root account after installation.

After MySQL is installed on windows, the system generates a license table and an account by default, you do not need to execute the mysql_install_db script on the Unix platform to generate an account and the corresponding permission table. However, if you do not use the MSI format to install MySQL, You need to manually add a new password to the root account after installation.

After MySQL is installed on windows, the system generates a license table and an account by default, you do not need to execute the mysql_install_db script on the Unix platform to generate an account and the corresponding permission table. However, if you do not use the MSI format to install MySQL, You need to manually add a new password to the root account after the installation, because the root account does not enable password protection by default, if you do not re-authorize the root account password, many non-local connections will fail. Follow these steps to update the password:

C:> mysql-u root

Mysql> set password for 'root' @ 'localhost' = password ('newpasswd ');

Mysql> set password for 'root' @ '%' = password ('newpasswd'); // optional

With the above settings, the root password is changed to newpasswd, and the root user's root password is set.

Note: For more exciting tutorials, please pay attention to the Sanlian graphic tutorial channel,

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.