0

I can install the mysql but while configuring it i am getting error like this: ** 1045 : access denied for user root@loaclhost.** i can install it i cant configure it. Please help...I am quite new to this.

1 Answers1

1

did you specify a password for the root user - there is no pwd for the root user by default so if you have not specified a password for the root user, you can connect like this:

mysql -u root 

if you specified a password, you can connect like this:

mysql -u root -p   (at which point you will get prompted for the password)

If you need to reset the password for root, you can try this:

  1. Stop MySQL
  2. Restart it manually with the skip-grant-tables option: mysqld_safe --skip-grant-tables
  3. Run the MySQL client: mysql -u root
  4. Reset the root password manually with this MySQL command: UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
  5. Flush the privileges with this MySQL command: FLUSH PRIVILEGES;

It would be good if you create a separate user and not use root for your DB operations (where you don't need root).

ali haider
  • 1,140
  • 3
  • 16
  • 29