I'm trying to connect to mysql server command line from my windows prompt
I write the next line in cmd but i get an error.
cd C:\MYSQL\bin\
And then i execute
mysql.exe -u=root -p=admin
but i getting this error
ERROR 1045: <28000>: Access denied for user 'root'@'localhost' <using password:YES>
Thanks,
You are logging in incorrectly; you should not include = in your login. So to log in, type:
If that doesn't work, then you may not have your system configured. If so, then here's a good tutorial on getting started with the MySQL prompt: http://breakdesign.blogspot.com/2007/11/getting-started-with-php-and-mysql-in_11.html
Your have to go on mysql installed path is on drive C:, then your commands need to be:
That will ask your MySql password over command prompt:
Put the password and you will get mysql dashboard.
owners.
Go to your MySQL directory. As in my case its...
It will ask for your password. If you have a password, Type your password and press "Enter", If no password set just press Enter without typing. You will be connected to MySQL.
There is another way to directly connect to MySQL without every time, going to the directory and typing down the commands.
Create a .bat file. First, add your path to MySQL. In my case it was,
Then add these two lines
If you don't want to type password every time you can simply add password with -p e.g. -proot (in case root was the password) but that is not recommended.
Also, If you want to connect to other host than local (staging/production server). You can also add -h22.345.80.09 E.g. 22.345.80.09 is your server ip.
Save the file. Just double click to open and connect directly to MySQL.
Use this :
then type password
i.e.
first type
cmd
then the windows command prompt will appear:where:
(After that you can open Windows Task Manager and verify in Processes tab is mysqld.exe process running. Maybe your problem is here.)
or make a start.bat file:
net start MySQL
mysql -u root -p
Good luck!
P.S.This is an answer from Poland.My president Lech Kaczyński was murdered 10.04.2010 in Smoleńsk. You need to know about this. Please read about it in the net.