Home Database Mysql Tutorial CentOS下安装启动MySQL及调用QT

CentOS下安装启动MySQL及调用QT

Jun 07, 2016 pm 05:00 PM
centos number

一、安装,启动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

linux

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SCP usage tips-recursively exclude files SCP usage tips-recursively exclude files Apr 22, 2024 am 09:04 AM

One can use the scp command to securely copy files between network hosts. It uses ssh for data transfer and authentication. Typical syntax is: scpfile1user@host:/path/to/dest/scp -r/path/to/source/user@host:/path/to/dest/scp exclude files I don't think you can when using scp command Filter or exclude files. However, there is a good workaround to exclude the file and copy it securely using ssh. This page explains how to filter or exclude files when copying directories recursively using scp. How to use rsync command to exclude files The syntax is: rsyncav-essh-

How to configure gateway in centos How to configure gateway in centos Apr 07, 2024 pm 08:51 PM

To configure CentOS as a gateway, you need to perform the following steps: 1. Configure the network interface and add the GATEWAY value; 2. Set the default gateway and specify DNS information; 3. Start the network service; 4. Test the gateway connection; 5. Configure the firewall (optional) Select) to allow traffic through the gateway.

How to open the linux terminal shortcut key How to open the linux terminal shortcut key Apr 11, 2024 pm 06:33 PM

Open Linux terminal shortcut key: Ctrl + Alt + T. Other methods include through the GUI or command line. You can also customize terminal shortcut keys.

What are the classifications of linux systems? What are the classifications of linux systems? Apr 12, 2024 pm 02:15 PM

Linux systems can be divided into 6 categories according to their uses and characteristics: desktop distributions (Ubuntu), server distributions (RHEL), embedded systems (Yocto Project), mobile operating systems (Android), cloud computing platforms and special-purpose distributions ( Kali Linux, Puppy Linux).

How to change centos to Chinese How to change centos to Chinese Apr 07, 2024 pm 08:42 PM

You can switch your CentOS system to Chinese by performing the following steps: Install Chinese language pack Enable Chinese language settings Update configuration file Generate regional settings Restart system Verify changes

Build a Git server under CentOS Build a Git server under CentOS Apr 15, 2024 pm 07:13 PM

1. First, you need to install Git. You can use the yum source to install it online: [root@localhostDesktop]#yuminstall-ygit2. Create a git user to run the git service addusergit3. Initialize the git warehouse: Here we choose /data/git/learngit. git as our git repository [root@localhostgit]#gitinit--barelearngit.gitInitializedemptyGitrepositoryin/data/git/learngit.git/ execute the above command

How to install Chinese input method in linux How to install Chinese input method in linux Apr 12, 2024 am 10:57 AM

Chinese input method installation steps: Determine the distribution version: Ubuntu, Fedora, CentOS, etc. Install the input method package: Ubuntu: sudo apt install ibus-pinyin Fedora: sudo dnf install ibus-pinyin CentOS: sudo yum install ibus-pinyin Configure the input method: Move Pinyin to the top of the list. Start the input method: Press Ctrl + Space. Test the input method: Using a text editor, try typing Chinese and verify that the Chinese characters are correct.

What versions of the server system are there? What versions of the server system are there? Apr 16, 2024 pm 12:52 PM

Server system versions typically include Linux (RHEL, CentOS, Ubuntu Server, Debian), Windows Server (Standard, Datacenter, Hyper-V), UNIX (Solaris, AIX, HP-UX), and macOS Server. Factors such as application compatibility, hardware support, security and stability, cost and support should be considered when selecting a system version.

See all articles