Home > Database > Mysql Tutorial > body text

Ubuntu 10.10下Qt连接MySQL数据库

WBOY
Release: 2016-06-07 17:03:38
Original
1116 people have browsed it

Ubuntu 10.10下Qt连接MySQL数据库是本文要介绍的内容,很详细的步骤,我们先来看内容。第一步:安装qt开发环境

Ubuntu 10.10下Qt连接Mysql数据库是本文要介绍的内容,,很详细的步骤,我们先来看内容。

第一步:安装qt开发环境

  • @linuxidc:~$sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer 
  • 第二步:安装mysql开发环境

  • @linuxidc:~$sudo apt-get install mysql-server mysql-client  
  • @linuxidc:~$sudo apt-get install libmysqlclient15-dev   
  • @linuxidc:~$sudo apt-get install libqt4-sql-mysql  
  • @linuxidc:~$sudo /etc/init.d/mysql restart 
  • 给特定用户分配数据操作权限的格式是:

    grant 权限1,权限2,...权限n on 数据库名称.表名称 to 用户名@用户ip地址 identified by '密码';

    编译:

  • @linuxidc:~$ qmake -project  
  • @linuxidc:~$ qmake 
  • 一定别忘了在工程的.pro文件里加上下面一行:

  • QT += sql  
  • @linuxidc:~$make  
  • @linuxidc:~$./mysql 
  • 小结:关于Ubuntu 10.10下Qt连接Mysql数据库的内容介绍完了,希望本文对你有所帮助!

    linux

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!