skip to Main Content

I install on Ubuntu LAMP with MYSQL. I try login to mysql by command mysql but there is an

Error 1045: Access denied for user ‘root’@’localhost’ (using password:
YES)

. I try use

Blockquote

sudo mysql_secure_installation

but it’s the same error

2

Answers


  1. Follow this step

    • Change the password of root by mysql prompt

      mysql -u root -p

    1. update password

      UPDATE mysql.user SET Password=PASSWORD(‘newpass’) WHERE User=’root’;

    2. Edited line in the file config.inc.php with the new root password:

      $cfg[‘Servers’][$i][‘password’] = ‘MyNewPass’

    Login or Signup to reply.
  2. When you are trying to access the database connection you need to give the password aswell. which you must have set during installation.

    If you don’t remember it you will have to reset the password.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search