MySQL ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no

Source: Internet
Author: User

After MySQL installs server side and client, log in to MySQL times wrong:
[[email protected] MySQL 5.6.23-rmp]# MySQL
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
[[email protected] MySQL 5.6.23-rmp]# service MySQL start
Starting MySQL. [OK]
[[email protected] MySQL 5.6.23-RMP for oraclelinux or rhel5-x86-64v74393-01]# mysql ERROR 1045 (28000): Access denied For user ' root ' @ ' localhost ' (using Password:no
The installation process has not set any password, reload many times is the same ....
==========================
Processing method:
Reset Forgotten MySQL Root Password:
First things first. Log in as root and stop the MySQL daemon.

sudo /etc/init.d/mysql stop

Now lets start up the MySQL daemon and skip the grant tables which store the passwords.

sudo mysqld_safe--skip-grant-tables&

(Press CTRL + C now to disown the process and start typing commands again)

You should see mysqld start up successfully. If not, well you have bigger issues. Now you should is able to connect to MySQL without a password.

sudo mysql--user=root mysql

Update user set Password=password (' New-password ');
Flush privileges;
Exit

Now kill your running mysqld then restart it normally.

sudo killall mysqld_safe&
(Press CTRL + C now to disown the process and start typing commands again)
/etc/init.d/mysql start

You should is good to go. Try not to forget your password again.

Https://www.howtoforge.com/reset-forgotten-mysql-root-password

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

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.