Install MySQL and sphinxse In the Sphinx series (1)

Source: Internet
Author: User

This article describes the installation method of the source code tarball, not the RPM installation method. To later use sphinx, install the MySQL sphinx engine during installation.

Find the MySQL source code download from the MySQL official website. The download here isGeneric Linux (Architecture independent), compressed tar archive(Mysql-5.1.52.tar.gz), as follows:

CD / USR / Local / SRC
Wget ftp://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.1/mysql-5.1.59.tar.gz - C

Find the Sphinx installation source code on the official sphinx website. Sphinx currently has 1.1beta and 0.9.9-Release versions. Version 1.1beta is not stable yet. Install the MySQL sphinx engine and prompt configure when compiling MYSQL: error: Unknown Plugin: SPHinX error. The 0.9.9-release version is as follows:

CD / USR / Local / SRC
Wget http: // Www.sphinxsearch.com / Downloads / Sphinx - 0.9 . 9 .Tar.gz - C

Decompress the downloaded files as follows:

Tar - Zxv - F MySQL - 5.1 . 52 .Tar.gz
Tar - Zxv - F sphinx - 0.9 . 9 .Tar.gz

Decompress the package to obtain the MySQLSource codeThe folder is/usr/local/src/mysql-5.1.52, the Sphinx source code file is/usr/local/src/sphinx-0.9.9, then copy all the files in the Sphinx source code folder/usr/local/src/sphinx-0.9.9/mysqlse to the MySQL source code folder/usr/local/src/mysql-5.1.52/storage/sphinx, as follows:

Mkdir / USR / Local / SRC / MySQL - 5.1 . 52 / Storage / Sphinx
CP / USR / Local / SRC / Sphinx - 0.9 . 9 / Mysqlse /*   / USR / Local / SRC / MySQL - 5.1 . 52 / Storage / Sphinx /

After copying, go to the MySQL source code file for compilation and installation, as shown below:

CD / USR / Local / SRC / MySQL - 5.1 . 52 /

. /Configure -- prefix =/usr/local/MySQL -- With-charset = utf8 -- With-extra-charset = all -- enable-thread-safe-client -- enable-character er --- readline -- With-big-tables -- With-named-Curses-libs =/usr/lib/libncursesw. so.5 -- With-plugins = sphins

Make & make install

After installation, initialize MYSQL as follows:

Groupadd MySQL # Add a MySQL user group
Useradd - G MySQL # Create a MySQL user and place it in the MySQL Group
Chown - R root: MySQL / USR / Local / MySQL # Modifying MySQL file attributes
/ USR / Local / MySQL / Bin / Mysql_install_db -- User = MySQL -- Dadadir =/ USR / Local / MySQL / VaR # Initialize the database. Specify the dadadir attribute here, or the starting MySQL .. manager of PID-file prompt will be displayed when MySQL is started.
Quit without updating f [failed] Error
Chown - R MySQL / USR / Local/MySQL / VaR # Modify attributes
CP / Root / MySQL - 5.1 . 52 / Support - Files / MySQL. Server / Etc / Init. d /
Chmod 700   / Etc / Init. d / MySQL. Server # Modify permissions
CP / Root / MySQL - 5.1 . 52 / Support - Files / My - Medium. CNF / Etc / My. CNF
/ Etc / Init. d / MySQL. Server start # Start
/ Etc / Init. d / MySQL. server stop # Stop

MySQL # enter the MySQL command line when the MySQL service is started

Show engines; # view the MySQL engine and you will see the Sphinx engine as follows:

Mysql> show engines;
+ ------------ + --------- + --------------------------------------------------------- + -------------- + ------ + ------------ +
| Engine | Support | comment | transactions | XA | savepoints |
+ ------------ + --------- + --------------------------------------------------------- + -------------- + ------ + ------------ +
| CSV | Yes | CSV storage engine | no |
| Sphinx | Yes | sphsf-storage engine 0.9.9 | no |
| Memory | Yes | hash based, stored in memory, useful for temporary tables | no |
| MyISAM | default engine as of MySQL 3.23 With great performance | no |
| Mrg_myisam | Yes | collection of identical MyISAM tables | no |
+ ------------ + --------- + --------------------------------------------------------- + -------------- + ------ + ------------ +
5 rows in SET (0.01 Sec)

 

Next time, we will talk about the installation and use of sphinx.

 

 

 

 

 

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.