Minor issues with using mysql in linux

Source: Internet
Author: User

Just migrated a project to the newly installed linux system, because mysql is used to install it:

Yum install mysql

Yum install mysql-server

Then start the mysql service:

Service mysqd start

At this time, you can log on, but the root user should have no password, which is not secure, so set the password:

Mysqladmin password '200'

Then, you cannot log on... No matter whether you enter the password 123 or not, you cannot log on... Thank you for your answers.

I can only stop the service first, and then reset the password. The second step is to enter mysql in special mode, not long term:

Service mysqld stop
Mysqld_safe -- skip-grant-tables &

Okay, you can go:

Mysql-uroot-p

Select database:

Use mysql;

Set password:
Update user set password = PASSWORD ("newpass") where user = "root ";
Update permission:
Flush privileges;
Exit:

Quit

Restart the mysql service:
Service mysqld restart
Enter the new password:
Mysql-uroot-p
 

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.