树莓派raspberry pi安装qt的mysql驱动
来源:互联网 发布:安卓apo源码 编辑:程序博客网 时间:2024/06/11 17:43
一、安装qt5
sudo apt-get install qt5-default
sudo apt-get install qtcreator
二、安装MariaDB
sudo apt-get install mariadb-server
允许远程连接
GRANT
ALL
PRIVILEGES
ON
*.*
TO
'root'
@
'%'
IDENTIFIED
BY
'123456'
WITH
GRANT
OPTION
;
flush
privileges
;
修改/etc/mysql/my.cnf文件。打开文件,找到下面内容:
- 1
- 2
- 3
- 1
- 2
- 3
把上面这一行注释掉或者把127.0.0.1换成合适的IP,建议注释掉。
三、安装QT的mysql驱动
很简单
sudo apt-get install libqt5sql5-mysql
四、测试是否安装成功
1、在pro文件中添加 QT += sql
2、
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QtSql/QSqlDatabase>
#include <QSqlDriver>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
qDebug()<<"Available drivers:";
QStringList drivers=QSqlDatabase::drivers();
foreach(QString dvr,drivers)
{
qDebug()<<dvr;
}
}
MainWindow::~MainWindow()
{
delete ui;
}
- 树莓派raspberry pi安装qt的mysql驱动
- 树莓派raspberry pi 安装mysql
- 树莓派Raspberry Pi的嵌入式QT平台
- Raspberry Pi 安装Sensor驱动
- 安装树莓派 Raspberry PI
- 树莓派(raspberry pi)学习16: 安装VNC,远程管理Raspberry Pi
- raspberry pi安装MySql无法登陆问题
- Raspberry Pi 树莓派的备份
- 基于Raspberry Pi Raspbian 的 Hadoop 安装
- 树莓派(raspberry pi) 系统安装WiFi网卡
- 树莓派Raspberry Pi首次安装配置
- 树莓派3初始化安装(Raspberry Pi III)
- raspberry pi树莓派系统快速安装
- 树莓派raspberry pi 安装远程工具teamviewer
- Raspberry Pi安装OpenELEC
- raspberry pi安装mentohust
- raspberry pi 2安装rtl8811/ 8821网卡驱动
- 树莓派(Raspberry Pi)的启动
- B 树详解
- ajax+php实现注册页面中自动检测用户名是否已经注册的功能
- php app接口设计安全
- Java爬虫入门简介(一) —— HttpClient请求及其使用方法
- 剑指offer-构建乘积数组
- 树莓派raspberry pi安装qt的mysql驱动
- Unity 2017.1正式版发布
- 代理原理及实现
- JSP执行过程
- 类和接口的关系
- Eclipse中Hibernate配置
- 最新版Ghost 1.0 RC1上手体验
- ARM开发(5)基于STM32的UART串口通信实验
- Spring Boot (八) 相关配置