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.
- Off-topic for SO: try Server Fault.eggyal– eggyal2012-07-22 09:20:47 +00:00Commented 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?ali haider– ali haider2012-07-22 13:47:24 +00:00Commented Jul 22, 2012 at 13:47
Add a comment |
1 Answer
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:
- Stop MySQL
- Restart it manually with the skip-grant-tables option: mysqld_safe --skip-grant-tables
- Run the MySQL client: mysql -u root
- Reset the root password manually with this MySQL command: UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
- 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).
- was this helpful and were you able to resolve the issue?ali haider– ali haider2013-04-08 16:12:37 +00:00Commented Apr 8, 2013 at 16:12