Korn Shell Connections to MySQL

  • Follow


I have several korn shell scripts I use with a MySQL database on the
same server (Solaris).   I am moving to a Linux environment where the
MySQL database is on another server.   I would like to convert the
database connection code to connect to the database on another Linux
server.   I see alot of information on Perl DBI CLI and PHP DBI CLI but
cannot find any examples of Korn Shell connecting to a database on
another server.

Is there a way to accomplish a network connection to a MySQL database
from Korn Shell?  Any examples or information would be much
appreciated!

mm

0
Reply mm 2/9/2006 12:27:31 AM

mm wrote:
> I have several korn shell scripts I use with a MySQL database on the
> same server (Solaris).   I am moving to a Linux environment where the
> MySQL database is on another server.   I would like to convert the
> database connection code to connect to the database on another Linux
> server.   I see alot of information on Perl DBI CLI and PHP DBI CLI but
> cannot find any examples of Korn Shell connecting to a database on
> another server.
>
> Is there a way to accomplish a network connection to a MySQL database
> from Korn Shell?  Any examples or information would be much
> appreciated!

I have spent the last one hour looking through sourceforge and
freshmeat for the k/sh scripts that I _know_ exist, because I've
seen them -- but no luck so far. Presumably someone else
posting to this thread will rectify this lack.

In the meantime, I'll beat Mr. Park to who first directs you to
his ambitious "Bash Dif" project of bash (sorry, not ksh)
enhancements, including an interface to mySQL:

http://home.eol.ca/~parkw/index.html#mysql

I'll keep looking, and for my own interest as well. My intuition
tells me, however, that the available solution is to find an ODBC
command line tool that ksh(1) can call and capture the output.

=Brian

0
Reply bsh 2/10/2006 11:57:51 PM


mm wrote:

> I have several korn shell scripts I use with a MySQL database on the
> same server (Solaris).   I am moving to a Linux environment where the
> MySQL database is on another server.   I would like to convert the
> database connection code to connect to the database on another Linux
> server.   I see alot of information on Perl DBI CLI and PHP DBI CLI but
> cannot find any examples of Korn Shell connecting to a database on
> another server.
> 
> Is there a way to accomplish a network connection to a MySQL database
> from Korn Shell?  Any examples or information would be much
> appreciated!

If you are using e.g. the "mysql" command line client, the client
should be able to connect to another server, too (without
any change to your script code).

Heiner
-- 
 ___ _
/ __| |_ _____ _____ _ _     Heiner STEVEN <heiner.steven@nexgo.de>
\__ \  _/ -_) V / -_) ' \    Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_|   http://www.shelldorado.com/
0
Reply Heiner 2/14/2006 8:27:11 PM

2 Replies
355 Views

(page loaded in 0.026 seconds)

Similiar Articles:













7/22/2012 5:10:16 PM


Reply: