SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    FL
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Show MySQL version.

    Is there a way to show the version of MySQL your running? like phpversion()?

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

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    FL
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    run this query:
    Code:
    select version()
    hmm... like this?
    Code:
    define ('DB_USER', 'myname');
    define ('DB_PASSWORD', 'pass');
    define ('DB_HOST', 'localhost');
    define ('DB_NAME', 'mydb');
    
    // Make the connnection and then select the database.
    $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
    mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
    $query="select version()";
    $result=mysql_query($query);
    mysql_close();

  4. #4
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes
    and one more thing when you do
    mysql_query() you should use die() here too. like
    mysql_query(die(mysql_error()); to see if query executed successfully or not
    just a suggestion

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    FL
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm..i tried the code above and got nothing. is there any other way to acomplish this?

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,328
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    do you have phpmyadmin or a similar front end program?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Wizard Chris82's Avatar
    Join Date
    Mar 2002
    Location
    Osnabrück
    Posts
    1,003
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also use mysql_get_server_info to get the version of your MySQL server.

  8. #8
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    FL
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    do you have phpmyadmin or a similar front end program?
    Yes, i have phpmyadmin.

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,328
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Toolband
    Yes, i have phpmyadmin.
    so, when you run this query --
    Code:
    select version()
    what do you get?
    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
  •