Install and start MySQL in CentOS and call QT

Source: Internet
Author: User
1. Install and start mySQL: 1. If mySQLetcrc. dinit. d. mysqldstart already exists in CentOS (start mySQL, you can run mySQL-r

1. Install and start mySQL: 1. If mySQL/etc/rc already exists in CentOS. d/init. d /. /mysqld start (to start mySQL, you can run mySQL-r

1. Install and start mySQL:

1. If mySQL already exists in CentOS

/Etc/rc. d/init. d/./mysqld start (start mySQL and run mySQL-root)

Edit the rc. local file # vi/etc/rc. d/rc. local

Add the following startup command

/Etc/rc. d/init. d/mysqld start

(MySQL automatically starts upon startup)

2. If no installation is available:

1>, yum install mysql ,,

After installation, repeat steps 1 to set Automatic Restart upon startup;

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

When the rpm package is installed, it is set to automatically restart upon startup. You do not need to repeat Step 1.

2. Compile and install mysql so that Qt can be called. 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 'your depath + =/usr/include/mysql' 'LIBS + =-L/usr/lib/mysql' mysql. pro

For 64-bit

Qmake-o Makefile 'your depath + =/usr/include/mysql' LIBS + =-L/usr/lib64/mysql' mysql. pro

Make

Cp libqsqlmysql. so.../../plugins/sqldrivers/

If the message "qpluginbase. pri: 10: Unknown replace function: qtLibraryTarget" is displayed during qmake

Because the export PATH =/opt/qtsdk-2010.04/qt/bin: $ PATH parameter (path) Error

If the prompt "../.../../SQL/drivers/mysql/qsql_mysql.h: 52: 19: error: mysql. h: No such file or directory" appears during make

Mysql-devel missing

Yum install mysql-devel

Make again

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.