SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to determine version of MySQL on server

    I'm aware of the easy way to put up a page that will convey all the PHP info

    <?php
    phpinfo();
    ?>

    Is there a similar way to find out about the MySQL that is running on a server?

    Thanks.

  2. #2
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,104
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    its in there
    under mysql look for "Client API version" and you have it.

    cheers
    Lorenw

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    perfect, thanks.

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    or run this query:
    Code:
    select version() as v
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I'm trying this code but it doesn't return anything. What am I doing wrong?

    $query = 'SELECT version() as v';
    $result = mysql_query($query);
    echo $result['v'];

  6. #6
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it should be like this:
    PHP Code:
    $query 'SELECT version() as v';
    $result mysql_query($query);
    $rows mysql_fetch_array($result);
    echo 
    $rows['v']; 
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, great, thanks! But this brings up something new. When I use the first method described above, that is look under mysql in the phpinfo(); results, it says mysql > Client API version > 3.23.56. But when I run this query it says 5.0.32-Debian_7etch1. So I'm confused. Is the mysql version I'm using 3.23 or 5.0? Thanks for any insight.

  8. #8
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,104
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I just ran r937's script and it returned 5.0.18-nt (running vista) and phpmyadmin also has version 5.0.18-nt
    phpinfo() tells me it is 5.0.22

    I dont remeber which version I installed and "manual.chm" says:
    This is the MySQL Reference Manual. It documents MySQL 5.0 up through 5.0.16.

    Document generated on: 2005-11-23

    I'm not sure what I am running.

    lorenw

  9. #9
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my version of phpMyAdmin (2.10.1) there are two related items on the mainpage:
    On the left under localhost it says:
    Server version: 5.0.32-Debian_7etch1
    On the right under phpMyAdmin - 2.10.1 it says:
    MySQL client version: 3.23.49

    So it appears that when I run r937's script it returns the server version, when I look under the phpinfo() it shows the client version.

    Can someone confirm and maybe give me some information on the difference between the Server version and the Client version or point me in a direction to learn more? Thanks!

  10. #10
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    the server version is the version of mysql you are running

    any other version is the version of whatever else it is -- the odbc driver, the client software, the php library, whatever
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •