ubuntu8.04 under MySQL change user and password

Source: Internet
Author: User

1. MySQL was recently reinstalled for system reasons, but it was not prompted to set the password during installation.

2. Modify user name and password steps

A.service MySQL Stop #停止mysql服务

B.sudo vim /etc/mysql/debian.cnf  #此文件内存放着默认的用户名debian-sys-maint和密码

This time the password is particularly complex and not conducive to memory

C. Change the xxx at user=xxxx to the MySQL user name you need

Change the XXX at password=xxx to the password you need

Attention: Since we use MySQL generally using the command mysql-u root-p into MySQL, where-u followed by root for the username, it is recommended to change the user name to root.

D. Type: Wq and then press ENTER

E.service MySQL start #启动mysql服务

3. Modified file

ubuntu8.04 under MySQL change user and password

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.