patternsqlMinor
MySQL Workbench asking for password
Viewed 0 times
workbenchpasswordmysqlforasking
Problem
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
as suggested here and checked that
My Question
Why
I have started mysql service by command
C:\> net start mysqlas 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 passwordMy Question
Why
New Server Instance in Workbench is asking for the password?Solution
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
There, you will see sample
Once you open notepad, add this under the [mysqld] header
Close notepad and Save my.ini
Next, run these lines
You will get a mysql prompt. Now run this:
Back at the DOS Prompt, do this:
Once Notepad is open, delete the line
Close notepad and Save my.ini
Once mysql is back up, test the password at the DOS prompt
If you get the mysql prompt, CONGRATULATIONS !!! You installed a password for root@localhost
Go back to MySQL Workbench and user
Give it a Try !!!
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 *.iniThere, you will see sample
.ini files. Let's pick my-small.ininet stop mysql
cd C:\Program Files\MySQL\MySQL Server 5.5
copy my-small.ini my.ini
cd data
del ib*
notepad my.iniOnce you open notepad, add this under the [mysqld] header
[mysqld]
skip-grant-tablesClose 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';
exitBack at the DOS Prompt, do this:
net stop mysql
notepad my.iniOnce Notepad is open, delete the line
skip-grant-tables from my.iniClose notepad and Save my.ini
net start mysqlOnce 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 passwordGive it a Try !!!
Code Snippets
cd C:\Program Files\MySQL\MySQL Server 5.5
dir *.ininet stop mysql
cd C:\Program Files\MySQL\MySQL Server 5.5
copy my-small.ini my.ini
cd data
del ib*
notepad my.ini[mysqld]
skip-grant-tablesnet start mysql
mysql (hit enter)mysql> UPDATE mysql.user SET PASSWORD=PASSWORD('mysecretpassword') WHERE user='root' AND host='localhost';
exitContext
StackExchange Database Administrators Q#21835, answer score: 4
Revisions (0)
No revisions yet.