Mysql – How to enter password in thesql5.5 using batch script

batch-fileMySQL

i have written a batch script but it still ask me for a password. i want to enter it automatically. please help me

here is my batch script :

setlocal EnableDelayedExpansion
c:
cd "C:\Program Files\MySQL\MySQL Server 5.5\bin"

mysql -u root -p root

but still in output it ask for a password as:

Enter Password :

i got the answer. for that find below my comment

Best Answer

You can't have a space between the option and the password. So it should be:

mysql -u root -proot

Or use --password=root