Jump to content

[SOLVED] Checking mysql version


wrathican

Recommended Posts

Hey people

 

im trying to make an installer script but want to make some server checks before the script works it's magic.

 

how can i check the version of mysql installed on the server.

i need to be able to check without running shell commands and without actually having to connect

 

Thanks

Wrath

Link to comment
https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/
Share on other sites

http://www.codingforums.com/showthread.php?t=95264

 

exec() and phpinfo() seem to be your best bets.

 

If you choose to go phpinfo(), rather than using this

 

$file = @file_get_contents("http://YOURDOMAINHERE/phpinfo.php");

 

You're better off with

 

ob-start();

phpinfo();

$file = ob_get_clean();

 

Since php does not have this information available (mysql is a separate service from the web server/php), the only way that will consistently work will involve you asking mysql what version it is, either through a query or a command line statement.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.