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.

2
  • Off-topic for SO: try Server Fault. Commented Jul 22, 2012 at 9:20
  • did you specify a pwd for the root user? have you tried resetting the pwd, logging in as root and tried againn? Commented Jul 22, 2012 at 13:47

1 Answer 1

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).

1
  • was this helpful and were you able to resolve the issue? Commented Apr 8, 2013 at 16:12

You must log in to answer this question.