Showing entries 1 to 2
Displaying posts with tag: hostname (reset)
In a proxy-ed world, where do connections come from?

Overview The Skinny

Database Proxies provide a single entry point into MySQL for the calling client applications.

Proxies are wonderful tools to handle various situations like a master role switch to another node for maintenance, or for transparency with read and write connections.

However, when the time comes to perform the switch action, all of the calling clients have been funneled through the proxy, so identification of the calling host from the database itself becomes difficult.

The Problem What is going on?

Let’s illustrate how not knowing the source of a client connection can be an issue for the database administrator…

In the following diagram, three client applications connect to a Tungsten Cluster via the Connector proxy:

[Read more]
mysql hostname prompt when host is localhost

I manage several mysql servers and often on these servers for security reasons the SUPER account is not allowed external network access, so access is made to localhost. When connecting to several hosts at the same time, for example from different ssh sessions, this can be inconvenient as the \h prompt only ever shows localhost and not the hostname of the server to which I’m connected.

The following small patch against 5.1.36 which can also be found here adds a new \H option which behaves the same as \h except in this case the hostname is shown.

diff --git a/Docs/mysql.info b/Docs/mysql.info
index 7747201..dffacfd 100644
--- a/Docs/mysql.info
+++ b/Docs/mysql.info
@@ -20512,6 +20512,8 @@ sequences.
 `\D'        The full current date
 `\d'        The default database
 `\h'        The server host
+`\H'        Same as `\h' except that if the server host is …
[Read more]
Showing entries 1 to 2