简体   繁体   中英

how to run mysql in the command line for windows

How can I run mysql using the command prompt or using the Git Bash for Windows . I have found some tutorials that will show that I need to access "mysqld.exe". In my case im using a XAMPP and the file is located in D:\\xampp\\mysql\\bin\\mysqld.exe

Thanks

Thanks for your answer I really appreciate it, but I have solved this issue already. Just in case someone will be checking on this post in the future here is the answer.

I'm using XAMPP for running my localhost and I didn't recognize that XAMPP has a built in shell tool. I'm really sorry for the trouble..

These are the binaries that come with a Windows installation of MySQL:

07/02/2014  10:31 AM    <DIR>          .
07/02/2014  10:31 AM    <DIR>          ..
06/12/2012  02:40 PM         2,571,264 bug25714.exe
06/12/2012  02:40 PM         1,901,568 comp_err.exe
06/12/2012  02:40 PM           211,072 echo.exe
06/12/2012  02:40 PM         2,300,032 myisamchk.exe
06/12/2012  02:40 PM         2,170,496 myisamlog.exe
06/12/2012  02:40 PM         2,210,432 myisampack.exe
06/12/2012  02:40 PM         2,155,136 myisam_ftdump.exe
06/12/2012  02:40 PM         2,726,016 mysql.exe
06/12/2012  02:40 PM         2,619,520 mysqladmin.exe
06/12/2012  02:40 PM         2,739,328 mysqlbinlog.exe
06/12/2012  02:40 PM         2,616,448 mysqlcheck.exe
06/12/2012  02:40 PM        13,379,072 mysqld-debug.exe
06/12/2012  02:40 PM         7,651,840 mysqld.exe
06/12/2012  02:40 PM         2,687,104 mysqldump.exe
06/12/2012  02:40 PM         2,611,328 mysqlimport.exe
06/12/2012  02:40 PM         2,692,224 mysqlmanager.exe
06/12/2012  02:40 PM         2,611,840 mysqlshow.exe
06/12/2012  02:40 PM         2,632,192 mysqlslap.exe
06/12/2012  02:40 PM         2,809,984 mysqltest.exe
06/12/2012  02:40 PM         3,033,600 mysql_client_test.exe
06/12/2012  02:40 PM         1,975,424 mysql_upgrade.exe
06/12/2012  02:40 PM         1,890,816 my_print_defaults.exe
06/12/2012  02:40 PM         1,874,432 perror.exe
06/12/2012  02:40 PM         1,881,600 replace.exe
06/12/2012  02:40 PM         1,862,144 resolveip.exe

The size isn't something you should focus on because this is 5.1 of mySQL and you're probably using a different version. However, I would bring your attention to "mysql.exe" which is the binary that you'll be typing your commands into and that will interact with the daemon, which is "mysqld.exe". Hope this helps

In command prompt :

D:\\xampp\\mysql\\bin>mysql -u username -p password

This should do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM