From: Ben Clewett Date: June 12 2007 5:41pm Subject: Re: MySql Host through Heartbeat List-Archive: http://lists.mysql.com/mysql/207431 Message-Id: <466EDABE.9040200@clewett.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Baron, Thanks for the fast reply. I like the idea of piping in the servername to a small table on startup. Since this will only change on startup, sounds like an excellent idea. Or I may upgrade to above 5.0.41... Regards, Ben Baron Schwartz wrote: > Hi, > > Ben Clewett wrote: >> Dear MySQL, >> >> I'm running 5.0.26 through Heartbeat. Which seems to work well, even >> as a replication slave and Heartbeat continously stopping and starting >> the server. >> >> The Heartbeat moves MySQL around from server to server when a failure >> occures. I am trying to find a way for MySQL to report the server >> host name on which it's currently sitting. Without any luck. >> >> Would any kind members know of a way of getting this information from >> MySQL? > > I only know of two ways, though there may be more. > > 1) The hostname system variable, which was added in 5.0.41 > (http://dev.mysql.com/doc/refman/5.0/en/releasenotes-cs-5-0-41.html) > > 2) Perhaps a UDF that makes a system call. > > There might be some external ways to do it also. For example, create a > table with a single row, and have a startup script replace the value in > it with the server's hostname upon startup. Then you can query this value. > > Cheers > Baron >