Check mySQL version on Mac 10.8.5

后端 未结 4 814
忘了有多久
忘了有多久 2021-02-05 04:38

How can I check (step-by-step ) the version of mySQL installed on my Mac 10.8.5?

I tried using command prompt, but couldn\'t figure out.

4条回答
  •  借酒劲吻你
    2021-02-05 05:16

    Every time you used the mysql console, the version is shown.

     mysql -u user
    

    Successful console login shows the following which includes the mysql server version.

    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 1432
    Server version: 5.5.9-log Source distribution
    
    Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql>
    

    You can also check the mysql server version directly by executing the following command:

    mysql --version
    

    You may also check the version information from the mysql console itself using the version variables:

    mysql> SHOW VARIABLES LIKE "%version%";
    

    Output will be something like this:

    +-------------------------+---------------------+
    | Variable_name           | Value               |
    +-------------------------+---------------------+
    | innodb_version          | 1.1.5               |
    | protocol_version        | 10                  |
    | slave_type_conversions  |                     |
    | version                 | 5.5.9-log           |
    | version_comment         | Source distribution |
    | version_compile_machine | i386                |
    | version_compile_os      | osx10.4             |
    +-------------------------+---------------------+
    7 rows in set (0.01 sec)
    

    You may also use this:

    mysql> select @@version;
    

    The STATUS command display version information as well.

    mysql> STATUS
    

    You can also check the version by executing this command:

    mysql -v
    

    It's worth mentioning that if you have encountered something like this:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket
    '/tmp/mysql.sock' (2)
    

    you can fix it by:

    sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
    

提交回复
热议问题