Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am trying to set MySQL server on my Windows 7 64 bit machine. I have downloaded MySQL server and MySQLWorkbench.

I have started mysql service by command

C:\> net start mysql

as suggested here and checked that mysqld.exe process is running. Now when I do New Server Instance in Workbench, it is asking for the password. I never entered or set the password

enter image description here

My Question

Why New Server Instance in Workbench is asking for the password?

share|improve this question
    
Have you tried just pressing OK? –  Phil Aug 1 '12 at 18:31
    
Yes, and all the three options - Open Database connection, Get Server version, Get server OS turned red with cross in front of them. –  Gaurav Agarwal Aug 1 '12 at 18:36
    
I am glad I could help. However, questions of this nature could be posted on StackOverflow.com or ServerFault.com. –  RolandoMySQLDBA Aug 1 '12 at 19:22
    
@RolandoMySQLDBA Really appreciate your help. –  Gaurav Agarwal Aug 1 '12 at 21:38

1 Answer 1

up vote 4 down vote accepted

You will need to give root@localhost a password

Since you just installed mysql, you are running with default settings, this means you have no my.cnf. You will have to create one.

Run the following at a DIS Prompt

cd C:\Program Files\MySQL\MySQL Server 5.5
dir *.ini

There, you will see sample .ini files. Let's pick my-small.ini

net stop mysql
cd C:\Program Files\MySQL\MySQL Server 5.5
copy my-small.ini my.ini
cd data
del ib*
notepad my.ini

Once you open notepad, add this under the [mysqld] header

[mysqld]
skip-grant-tables

Close notepad and Save my.ini

Next, run these lines

net start mysql
mysql (hit enter)

You will get a mysql prompt. Now run this:

mysql> UPDATE mysql.user SET PASSWORD=PASSWORD('mysecretpassword') WHERE user='root' AND host='localhost';
exit

Back at the DOS Prompt, do this:

net stop mysql
notepad my.ini

Once Notepad is open, delete the line skip-grant-tables from my.ini

Close notepad and Save my.ini

net start mysql

Once mysql is back up, test the password at the DOS prompt

mysql -uroot -p (hit enter)
Password: (type mysecretpassword and hit enter)

If you get the mysql prompt, CONGRATULATIONS !!! You installed a password for root@localhost

Go back to MySQL Workbench and user mysecretpassword as the password

Give it a Try !!!

share|improve this answer
    
I retried it and it work. I cannot thanks you more. –  Gaurav Agarwal Aug 1 '12 at 22:04

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.