CentOS下安装启动MySQL及调用QT
一、安装,启动mySQL:1、CentOS中如果已经有了mySQL /etc/rc.d/init.d/./mysqld start (启动mySQL, 此时可以运行mySQL -r
一、安装,启动mySQL:
1、CentOS中如果已经有了mySQL
/etc/rc.d/init.d/./mysqld start (启动mySQL, 此时可以运行mySQL -root)
编辑rc.local文件 #vi /etc/rc.d/rc.local
加入如下启动命令
/etc/rc.d/init.d/mysqld start
(mySQL 开机自动启动)
2、如果没有安装:
1>、yum install mysql,,
安装后 需要重复 1 的步骤 设置开机自动重启;
2>、 p { margin-bottom: 0.08in; }
For CentOS 32-bit system: Get rpm
wget
wget
wget
wget
wget
p { margin-bottom: 0.08in; }
wget
For CentOS 64-bit system: Get rpm
p { margin-bottom: 0.08in; }
wget
wget
wget
wget
wget
Install
rpm -iUvh MySQL-server-community-5.0.92-1.rhel5.i386.rpm
rpm -iUvh MySQL-client-community-5.0.92-1.rhel5.i386.rpm
rpm -iUvh MySQL-devel-community-5.0.92-1.rhel5.i386.rpm
rpm -iUvh MySQL-shared-community-5.0.92-1.rhel5.i386.rpm
rpm -iUvh MySQL-shared-compat-5.0.92-1.rhel5.i386.rpm
rpm包安装会设置开机自动重启,不需要重复1的步骤。
二、编译安装mysql 使Qt能调用。 p { margin-bottom: 0.08in; }
export PATH=/opt/qtsdk-2010.04/qt/bin:$PATH
cd /opt/qtsdk-2010.04/qt/src/plugins/sqldrivers/mysql/
for 32-bit:
qmake -o Makefile 'INCLUDEPATH+=/usr/include/mysql' 'LIBS+=-L/usr/lib/mysql' mysql.pro
for 64-bit
qmake -o Makefile 'INCLUDEPATH+=/usr/include/mysql' 'LIBS+=-L/usr/lib64 /mysql' mysql.pro
make
cp libqsqlmysql.so ../../../../plugins/sqldrivers/
如果在qmake时候提示:qpluginbase.pri:10: Unknown replace function: qtLibraryTarget
则是因为export PATH=/opt/qtsdk-2010.04/qt/bin:$PATH 参数(path)错误
如果在make时候提示:../../../sql/drivers/mysql/qsql_mysql.h:52:19: error: mysql.h: No such file or directory
缺少mysql-devel
yum install mysql-devel
重新make
推荐阅读
-
CentOS下安装启动MySQL及调用QT
-
CentOS7下MySQL服务启动失败原因及解决方法
-
CentOS下PHP7的编译安装及MySQL的支持和一些常见问题的解决办法
-
阿里云Centos7下安装Redis及tomcat设置自启动的方法
-
CentOS-7-1804下MySQL安装及防火墙设置
-
Linux(centOS6.5)下SVN的安装、配置及开机启动
-
Linux(centOS6.5)下SVN的安装、配置及开机启动
-
mysql下centos安装mariadb的方法及遇到的问题
-
VMware workstation16 中Centos7下MySQL8.0安装过程及Navicat远程连接
-
CentOS7下MySQL服务启动失败原因及解决方法