MySQL Proxy Scripting
1405
if the content of the Lua script changes while
mysql-proxy
is running, the updated content is
automatically used when a new connection is made.
•
--pid-file=file_name
[1405]
Command-Line Format
--pid-file=file_name
Option-File Format
pid-file=file_name
Permitted Values
Type
file name
The name of the file in which to store the process ID.
•
--user=user_name
[1405]
Command-Line Format
--user=user_name
Option-File Format
user=user_name
Permitted Values
Type
string
Run
mysql-proxy
as the specified
user
.
•
--version
[1405]
,
-V
Command-Line Format
--version
-V
Show the version number.
The most common usage is as a simple proxy service (that is, without additional scripting). For basic
proxy operation, you must specify at least one
proxy-backend-addresses
option to specify the
MySQL server to connect to by default:
shell>
mysql-proxy --proxy-backend-addresses=MySQL.example.com:3306
The default proxy port is
4040
, so you can connect to your MySQL server through the proxy by
specifying the host name and port details:
shell>
mysql --host=localhost --port=4040
If your server requires authentication information, this will be passed through natively without alteration
by
mysql-proxy
, so you must also specify the required authentication information:
shell>
mysql --host=localhost --port=4040 \
--user=user_name --password=password
You can also connect to a read-only port (which filters out
UPDATE
and
INSERT
queries) by connecting
to the read-only port. By default the host name is the default, and the port is
4042
, but you can alter the
host/port information by using the
--proxy-read-only-backend-addresses
[1403]
command-
line option.
For more detailed information on how to use these command-line options, and
mysql-proxy
in
general in combination with Lua scripts, see
Section 15.7.5, “Using MySQL Proxy”
.
15.7.4. MySQL Proxy Scripting
You can control how MySQL Proxy manipulates and works with the queries and results that are passed
on to the MySQL server through the use of the embedded Lua scripting language. You can find out
more about the Lua programming language from the
Lua Web site
.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...