MySQL Change password, remote permissions

Source: Internet
Author: User

System centos7,mysql5.7

1, the first time after the installation of MySQL temporary password

>grep "Password"/var/log/mysqld.log

Shown below:

................. A temporary password is generated for [email protected]: i8ulno2zrc+a

"I8ulno2zrc+a" This sentence is just installed after the temporary password, the first login must change the password

2, the first time to login to change the password

Alter user ' root ' @ ' localhost ' identified by ' new password ';

1. Forget the password you changed

>vim/etc/my.cnf

[Mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
Skip-grant-tables-----> Add content ' Skip authorization check '

2. Restart MySQL Service

>systemctl Stop Mysqld.service

>systemctl Start Mysqld.service

3. Enter MySQL

>mysql

mysql> Update user Set Authentication_string=password (' 123456 ') where user= ' root ';

1. Remote Link permissions

Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' your password ';

MySQL Change password, remote permissions

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.