wrathican Posted October 24, 2008 Share Posted October 24, 2008 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 More sharing options...
dennismonsewicz Posted October 24, 2008 Share Posted October 24, 2008 you could create an info.php script like this <?php phpinfo(); ?> And then just run it in your browser Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673703 Share on other sites More sharing options...
wrathican Posted October 24, 2008 Author Share Posted October 24, 2008 sorry i should have said, the script needs to be able to check the version. not the user. Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673712 Share on other sites More sharing options...
dennismonsewicz Posted October 24, 2008 Share Posted October 24, 2008 try this http://us3.php.net/manual/en/function.mysql-get-server-info.php Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673732 Share on other sites More sharing options...
discomatt Posted October 24, 2008 Share Posted October 24, 2008 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(); Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673737 Share on other sites More sharing options...
discomatt Posted October 24, 2008 Share Posted October 24, 2008 try this http://us3.php.net/manual/en/function.mysql-get-server-info.php Requires connection. Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673738 Share on other sites More sharing options...
PFMaBiSmAd Posted October 24, 2008 Share Posted October 24, 2008 phpinfo() only shows the client library version. Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673739 Share on other sites More sharing options...
wrathican Posted October 24, 2008 Author Share Posted October 24, 2008 Thanks for the replies. dennis: what discomatt said discomatt: what PFMaBiSmAd said and i was thinking to do what you said, but then i found that out. any other suggestions? Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673742 Share on other sites More sharing options...
PFMaBiSmAd Posted October 24, 2008 Share Posted October 24, 2008 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. Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673747 Share on other sites More sharing options...
discomatt Posted October 24, 2008 Share Posted October 24, 2008 No, I don't think there's a consistent way without connecting or using a command-line call. What's wrong with connecting first? Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673749 Share on other sites More sharing options...
wrathican Posted October 24, 2008 Author Share Posted October 24, 2008 oh nothing, i just wanted the to see if it was possible to make sure everything was ok before anything is installed. Thanks for the help anyway chaps. I guess i'm going to have to connect first Link to comment https://forums.phpfreaks.com/topic/129958-solved-checking-mysql-version/#findComment-673752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.