Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jul 23 '12 at 0:01

This question came from our site for professional and enthusiast programmers.

    
Off-topic for SO: try Server Fault. –  eggyal Jul 22 '12 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 Jul 22 '12 at 13:47

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

share|improve this answer
    
was this helpful and were you able to resolve the issue? –  ali haider Apr 8 '13 at 16:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.