[mysql] MySQL command line client for Windows

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.

This question is related to mysql windows

The answer is


mysql.exe is included in mysql package. You don't have to install anything additionally.


If you are looking for tools like the the mysql and mysqldump command line client for Windows for versions around mysql Ver 14.14 Distrib 5.6.13, for Win32 (x86) it seems to be in HOMEDRIVE:\Program Files (x86)\MySQL\MySQL Workbench version

This directory is also not placed in the path by default so you will need to add it to your PATH environment variable before you can easily run it from the command prompt.

Also, there is a mysql utilities console but it does not work for my needs. Below is a list of the capabilities on the mysql utilities console in case it works for you:

Utility           Description
----------------  ---------------------------------------------------------
mysqlauditadmin   audit log maintenance utility
mysqlauditgrep    audit log search utility
mysqldbcompare    compare databases for consistency
mysqldbcopy       copy databases from one server to another
mysqldbexport     export metadata and data from databases
mysqldbimport     import metadata and data from files
mysqldiff         compare object definitions among objects where the
                  difference is how db1.obj1 differs from db2.obj2
mysqldiskusage    show disk usage for databases
mysqlfailover     automatic replication health monitoring and failover
mysqlfrm          show CREATE TABLE from .frm files
mysqlindexcheck   check for duplicate or redundant indexes
mysqlmetagrep     search metadata
mysqlprocgrep     search process information
mysqlreplicate    establish replication with a master
mysqlrpladmin     administration utility for MySQL replication
mysqlrplcheck     check replication
mysqlrplshow      show slaves attached to a master
mysqlserverclone  start another instance of a running server
mysqlserverinfo   show server information
mysqluserclone    clone a MySQL user account to one or more new users

I have similar requirement where I need a MySQL client but not server (running in a virtual machine and don't want any additional overhead) and for me the easiest thing was to install MySQL community server taking typical installation options but NOT configure the server, so it never starts, never runs. Added C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin to system path environment variable and I'm able to use the MySQL command line client mssql.exe and mysqladmin.exe programs.


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.


download the mysql-5.0.23-win32.zip (this is the smallest possible one) from archived versions in mysql.com website

cut and paste the installation in c drive as mysql folder

then install then follow instructions as per this page: https://cyleft.wordpress.com/2008/07/20/fixing-mysql-service-could-not-start-1067-errors/


For Windows users: 1.Install the full version of MYSQL 2.On the Windows 10 start button click on search and type in MySQL 3. Select the MYSQL Command Line Client 5.5 (I am using version 5.5) 4. go ahead and run your sql queries/ 5. to exit type \q or quit


You can access mySQL in command line just by typing:

C:\www\mysql\bin> mysql -u root -p

After which you can type sql commands normally such as:

mysql> SHOW DATABASES;

Here, I am assuming you mySQL installation directory is C:\www\mysql.


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....


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 -ppress 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. enter image description here

enter image description here

Happy Coding.


Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to windows

"Permission Denied" trying to run Python on Windows 10 A fatal error occurred while creating a TLS client credential. The internal error state is 10013 How to install OpenJDK 11 on Windows? I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? git clone: Authentication failed for <URL> How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" XCOPY: Overwrite all without prompt in BATCH Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory how to open Jupyter notebook in chrome on windows Tensorflow import error: No module named 'tensorflow'