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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



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-

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.

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

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).

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

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

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.

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.
