MySQLERROR1045 (28000): Accessdeniedforuser 'root' @ 'loc

Source: Internet
Author: User
Ubuntu8.04 has just installed mysqlsudoapt-getinstallmysql. The installation is successful. You must enter the password and password at the end of the installation.

Ubuntu 8.04 has just installed mysqlsudo apt-get install mysql. After installation, you must enter the password and OKmysql-uroot-p.

Ubuntu 8.04 has just installed mysql

Sudo apt-get install mysql

The installation is successful. You must enter the password and OK for the installation.

Mysql-uroot-p

Enter the password.

An error occurred!

ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YSE)

Ask a friend, he said that the initial password is empty, but I named the password.

Leave the password Blank

Or error!

ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)

Change the password!

#/Etc/init. d/mysql stop
# Mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking &
# Mysql-u root mysql
Mysql> UPDATE user SET Password = PASSWORD ('newpassword') where USER = 'root ';
Mysql> flush privileges;
Mysql> quit

#/Etc/init. d/mysqld restart
# Mysql-uroot-p
Enter password:

Mysql>

Done!

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.