Hi,
Does anyone have a solution to find out the installed MySQL version without the connection details? Maybe by reading some specific files?
Find out MySQL version without the database details?
Moderator: General Moderators
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: Find out MySQL version without the database details?
Can always do
Code: Select all
$ mysqld --versionRe: Find out MySQL version without the database details?
If you have commandline/SSH access you can just do `mysql -V`
Code: Select all
[root@mike-hub httpdocs]# mysql -V
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (x86_64) using readline 5.0Re: Find out MySQL version without the database details?
Code: Select all
<?php
//Call to discover PHP information on your server.
phpinfo();
?>
Re: Find out MySQL version without the database details?
This is a pretty dirty way of doing it, but it works on Windows and should work on Unix.
Edit: This post was recovered from search engine cache.
Code: Select all
<?php
function get_mysql_version ()
{
ob_start();
phpinfo(INFO_MODULES);
preg_match('#<td class="e">Client API version </td><td class="v">([0-9.]+) </td>#', ob_get_contents(), $matches);
ob_end_clean();
return isset($matches[1]) ? $matches[1] : false;
}
echo 'MySQL Version: '.get_mysql_version();
?>
Last edited by McInfo on Tue Jun 15, 2010 10:08 pm, edited 1 time in total.
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: Find out MySQL version without the database details?
It was simpler then I thought: mysqli_get_client_info(); 
Re: Find out MySQL version without the database details?
I overlooked that one because I saw that both mysql_get_host_info() and mysql_get_server_info() have a link resource parameter. Haste makes waste, I guess.
Edit: This post was recovered from search engine cache.
Edit: This post was recovered from search engine cache.