MySQL command line client for Windows
Question
Is there any nice command line MySQL client for windows? I mean a single exe that allows connecting and running a sample query. I've googled and only could find big graphical environments like toad or mysql workbench. I need only a simple command line tool, where can I download sth like this?
EDIT: I don't want to install the whole MySQL package on my PC. I know it's inside the mysql package but how do I download only this cmd line client. Because i don't need anything else.
Accepted Answer
When you go to the MySQL download page, choose the platform "Microsoft Windows". Then download the "Windows (x86, xx-bit), ZIP Archive" (be sure to select the one with size over 140M.
The binaries will be in the "bin" folder.
I understand that this is not just the client binaries, but at least you don't have to install and setup the entire server.
Read more... Read less...
mysql.exe can do just that....
To connect,
mysql -u root -p
(press enter)
It should prompt you to enter root password (u = username, p = password)
Then you can use SQL database commands to do pretty much anything....
You can choose only install the client during server install. The website only offers to let you download the full installer (grab whatever version you want from http://www.mysql.com/downloads/mysql/).
In the install wizard, when prompted for installation type (typical, minimal, custom), choose 'Custom'. On the next screen, select to NOT install the server, and proceed with the rest of the install as normal.
When you're done, you should see just the relevant client programs (mysql, mysqldump, etc) in C:\Program Files\MySQL..\bin
You can also download MySql workbench (31Mo) which includes mysql.exe
and mysqldump.exe
.
I successfully tested this when i had to run Perl scripts using DBD:MySql
module to run SQL statements against a distant MySql db.
Its pretty simple. I saved the mysql community server in my D:\
drive. Hence this is how i did it.
Goto D:\mysql-5.7.18-winx64\bin
and in the address bar type cmd and press enter, so command prompt will open. Now if you're using it for the first time type as mysql -u root -p
press enter. Then it will ask for password, again press enter. Thats it you are connected to the mysql server.
Before this make sure wamp or xampp any of the local server is running
because i couldn't able to connect to mysql wihthout xampp running.
Happy Coding.