tags:

views:

25

answers:

3

when I am trying to connect mySql data base from cmd it giving some error like -

c:\xampp\mysql\bin>mysqladmin -u root password 123123 mysqladmin: connect to server at localhost failed
error:Access denied for user root@localhost (using password : NO)

+1  A: 

Shouldn't that be:

mysqladmin -u root -p PASSWORD

?

Roberto Aloi
how can I reset my root password??
nectar
Tr this one: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-windows
Roberto Aloi
A: 

The syntax looks wrong to me, just like Roberto said. You could also use this

mysqladmin -u root -h localhost -p

It should then ask you for the password. This way you can be sure that only a wrongly entered PW prevents you from connecting.

janb
A: 

It should be:

mysqladmin -u root -p

and it will prompt you for a password. If you need to enter the password directly via the command line ( say you need to write a script), you should be able to do that with:

mysqladmin -u root -p123123
mmattax