在Mac 10.8.5上检查mySQL版本 [英] Check mySQL version on Mac 10.8.5

查看:97
本文介绍了在Mac 10.8.5上检查mySQL版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查(逐步)安装在Mac 10.8.5上的mySQL版本?

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.

推荐答案

每次使用mysql控制台时,都会显示版本.

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

 $ mysql -u user

成功的控制台登录显示以下内容,其中包括mysql服务器版本.

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>


您还可以通过执行以下命令直接检查mysql服务器版本:


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

$ mysql --version


您还可以使用版本变量从mysql控制台本身检查版本信息:


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

mysql> SHOW VARIABLES LIKE "%version%";

输出将如下所示:

+-------------------------+---------------------+
| 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)

您也可以使用此:

mysql> select @@version;


STATUS命令也显示版本信息.


The STATUS command display version information as well.

mysql> STATUS


您还可以通过执行以下命令来检查版本:


You can also check the version by executing this command:

mysql -v

如果您遇到过这样的事情:

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

这篇关于在Mac 10.8.5上检查mySQL版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆