怎样查看mysql版本的五种方法

怎样查看mysql版本的五种方法,第1张

查看版本信息 #1使用命令行模式进入mysql会看到最开始的提示符 Your MySQL connection id is 3 Server version: 5.1.69 Source distribution #2命令行中使用status可以看到 复制代码 代码如下:mysql>status-------------- mysql Ver 14.14 Distrib 5.1.69, for redhat-linux-gnu (x86_64) using readline 5.1 Connection id:3 Current database: Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile:'' Using delimiter:Server version:5.1.69 Source distribution Protocol version:10 Connection: Localhost via UNIX socket Server characterset:utf8 Db characterset:utf8 Client characterset:utf8 Conn. characterset:utf8 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 3 days 14 hours 50 sec Threads: 1 Questions: 5 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.0 #3 使用系统函数 复制代码 代码如下:mysql>select version()+-----------+ | version() | +-----------+ | 5.1.69 | +-----------+ 1 row in set (0.12 sec) #4 $ mysql --help | grep Distrib mysql Ver 14.14 Distrib 5.1.69, for redhat-linux-gnu (x86_64) using readline 5.1 #5 包管理工具(根据不同系统 rh系列或则是bsd系列) $ rpm -qa|grep mysql qt-mysql-4.6.2-20.el6.x86_64 mysql-server-5.1.69-1.el6_4.x86_64 mysql-libs-5.1.69-1.el6_4.x86_64 mysql-5.1.69-1.el6_4.x86_64 mysql-devel-5.1.69-1.el6_4.x86_64

Ubuntu新环境下搭建django rest api时安装MySQL-python 报错。

需要安装(sudo)apt-get install python-dev

python-dev 是必须的  ---- error: Python.h

你需要自己安装一个源外的python类库, 而这个类库内含需要编译的调用python api的c/c++文件

你自己写的一个程序编译需要链接libpythonXX.(a|so)

(注:以上不含使用ctypes/ffi或者裸dlsym方式直接调用libpython.so)

其他正常使用python或者通过安装源内的python类库的不需

Installing collected packages: MySQL-python

Running setup.py install for MySQL-python ... error

Complete output from command /usr/bin/python -u -c "import setuptools, tokenize__file__='/tmp/pip-build-ZzcKHT/MySQL-python/setup.py'f=getattr(tokenize, 'open', open)(__file__)code=f.read().replace('\r\n', '\n')f.close()exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-Ur_CBU-record/install-record.txt --single-version-externally-managed --compile:

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying _mysql_exceptions.py ->build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/__init__.py ->build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/converters.py ->build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/connections.py ->build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/cursors.py ->build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/release.py ->build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/times.py ->build/lib.linux-x86_64-2.7/MySQLdb

creating build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/__init__.py ->build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/CR.py ->build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/FIELD_TYPE.py ->build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/ER.py ->build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/FLAG.py ->build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/REFRESH.py ->build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/CLIENT.py ->build/lib.linux-x86_64-2.7/MySQLdb/constants

running build_ext

building '_mysql' extension

creating build/temp.linux-x86_64-2.7

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o

_mysql.c:29:20: fatal error: Python.h: No such file or directory

#include "Python.h"

^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize__file__='/tmp/pip-build-ZzcKHT/MySQL-python/setup.py'f=getattr(tokenize, 'open', open)(__file__)code=f.read().replace('\r\n', '\n')f.close()exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-Ur_CBU-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ZzcKHT/MySQL-python/


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/8525758.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-17
下一篇 2023-04-17

发表评论

登录后才能评论

评论列表(0条)

保存