Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enter password in mysql5.5 using batch script?

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

like image 302
Pratik Gujarathi Avatar asked Jan 20 '26 13:01

Pratik Gujarathi


1 Answers

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

mysql -u root -proot

Or use --password=root

like image 68
ChrisPatrick Avatar answered Jan 23 '26 19:01

ChrisPatrick