Connect to mysql on linux from a dos prompt

Posted on 2006-11-28
Last Modified: 2009-07-29
I have mysql installed on linux.  I would like to connect to it from dos.  What do I need to install on my windows machine.

And what would the connection string be?


Question by:jmsloan
LVL 12

Expert Comment

ID: 18031436
use putty,

also you will have to make some changes in the linux server to allow connections from other machines... here are the steps..

Author Comment

ID: 18032053
Currently I can run a batch file that opens up sqlplus run sqlplus commands that update oracle then closes.

I need to find the equivalant to do the same to a mysql database

Author Comment

ID: 18032141
Here is what is done for sqlplus at the dos prompt.

sqlplus username/password@database

To get mysql to work I would need to have a odbc driver set but what program would be equivalant to sqlplus

Expert Comment

ID: 18032247
linux uses scripts just like dos uses .bat files.

in the script put the command you want executing and then chmod to 777 e.g:
chmod 775 myscript

This makes the script exectuable. Then once you've ssh'd, or telnet'd in, you can just type "myscript" (without the quotes) and it'll run like a .bat file.
LVL 19

Accepted Solution

VoteyDisciple earned 100 total points
ID: 18033192
MySQL exists for Windows too; see 

Just install MySQL on your Windows computer and you can connect to your database from there exactly (EXACTLY) the same way you could from a Linux box:

mysql -h your_hostname -u your_username -p database_name

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (, A SQLite Tidbit: Quick Numbers Table Generation (…
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question