Unix questions - Linux KSH93 Connecting to a networked MySQL database.

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > February 2006 > Linux KSH93 Connecting to a networked MySQL database.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Linux KSH93 Connecting to a networked MySQL database.
mm

2006-02-08, 9:06 pm

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

techrock

2006-02-11, 6:06 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!
>
>
> mm


Hi mm,

I'm guessing within your korn shell script, you are just connecting to
mysql via the binary client (mysql). You would have something like:

mysql -uUSER -pPASSWORD -DDATABASE -e SQL.

By default mysql client will use a pipe file. To have it connect over
the network instead, just add -h hostname. If mysql is not running on
the default port, you also need -P PORTNUM. Try running mysql -h for
more info.
________________________________________
________
TechRock
+-. .
| | .-. .-- | / _/ \_
+-. | | | +-. \ /
| \ ._. ._ | \ /_ _\
| \____________ \./ s.homedns.org
by goldenfeather.homedns.org

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com