过程中用到的安装包在百度网盘中,地址https://pan.baidu.com/s/1LfHAxKxYaqI_Ez5ixPzrUw 提取码 83b0
一、安装MYSQL
1.下载安装包,https://downloads.mysql.com/archives/community/
选择mysql5.7.29,系统选择ubuntu,系统版本选择ubuntu18.04(x86,64bit)
2.下载mysql安装包需要的依赖库,libaio1_0.3.110-2_amd64和deb,libmecab2_0.996-1.2ubuntu1_amd64.deb
libmecab2下载地址
http://th.archive.ubuntu.com/ubuntu/pool/universe/m/mecab/libmecab2_0.996-1.2ubuntu1_amd64.deb
libaio1下载地址
http://th.archive.ubuntu.com/ubuntu/pool/main/liba/libaio/libaio1_0.3.110-2_amd64.deb
3.安装mysql
解压mysql安装包tar -xf mysql-server_5.7.29-1ubuntu18.04_amd64.deb-bundle.tar
按照如下顺序安装
sudo dpkg -i mysql-common_5.7.29-1ubuntu18.04_amd64.deb
//下一步设置mysql密码
sudo dpkg-preconfigure mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqlclient20_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-client_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-common_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb
测试mysql
mysql -u root -p 123
二、安装QT
1.下载QT安装包
下载5.11.3qt安装包(此安装包内包含访问mysql的驱动文件,有些版本的qt不包含)
http://download.qt.io/new_archive/qt/5.11/5.11.3/qt-opensource-linux-x64-5.11.3.run
2.安装qt
a.断开网络连接,不然在安装时需要你登录QT账号.
b.给安装包权限 chmod 777 qt-opensource-linux-x64-5.11.3.run
c.安装 sudo ./qt-opensource-linux-x64-5.11.3.run
d.现在打开qtcreator新建工程发现根本用不了。还需要安装make和g++
3.安装make,g++
a.安装make http://th.archive.ubuntu.com/ubuntu/pool/main/m/make-dfsg/make_4.1-9.1ubuntu1_amd64.deb
b.安装g++, g++_7.4.0-1ubuntu2.3_amd64.deb
4.安装qt访问mysql的驱动依赖库libmysqlclient.so.18
https://cdn.mysql.com/archives/mysql-5.6/libmysqlclient18_5.6.47-1debian9_amd64.deb
到此QT只能使用控制台程序去访问MYSQL,并不能创建窗体程序
创建窗体程序提示找不到 -libGL需要安装此库。