Using Client Programs in a Multiple-Server Environment
•
On Unix, set the
MYSQL_UNIX_PORT
Unix socket file and TCP/IP port number before you start your clients. If you normally use a specific
socket file or port number, you can place commands to set these environment variables in your
file so that they apply each time you log in. See
.login
•
Specify the default Unix socket file and TCP/IP port number in the
file. For example, you can use
on Unix. See
Section 4.2.3.3, "Using Option
• In a C program, you can specify the socket file or port number arguments in the
mysql_real_connect()
mysql_options(). See
• If you are using the Perl
example:
$dsn = "DBI:mysql:test;mysql_read_default_group=client;"
. "mysql_read_default_file=/usr/local/mysql/data/my.cnf";
$dbh = DBI->connect($dsn, $user, $password);
See
Section 20.8, "MySQL Perl
Other programming interfaces may provide similar capabilities for reading option files.
and
MYSQL_TCP_PORT
on Windows, or the
C:\my.cnf
Files".
call. You can also have the program read option files by calling
Section 20.6.6, "C API Function
module, you can read options from MySQL option files. For
DBD::mysql
API".
557
environment variables to point to the
Section 2.21, "Environment
group of an option
[client]
file in your home directory
.my.cnf
Descriptions".
Variables".