Book Image

MariaDB Cookbook

By : Daniel Bartholomew
Book Image

MariaDB Cookbook

By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring the Sphinx daemon


In order to use Sphinx, we need to add a user to our MariaDB database and configure the Sphinx daemon so that it indexes the content we want it to.

Getting ready

Install the SphinxSE as described in the Installing SphinxSE in MariaDB recipe in this chapter. Install the Sphinx daemon as described in either the Installing the Sphinx daemon on Linux recipe or the Installing the Sphinx daemon on Windows recipe, both in this chapter, depending on which operating system we are using.

How to do it...

  1. Open the mysql command-line client and create a user with SELECT rights for the tables in the databases we want the Sphinx daemon to index, using the following statements:

    CREATE USER 'sphinx'@localhost 
      IDENTIFIED BY 'sphinxsecretpassword';
    GRANT SELECT on test.* to 'sphinx'@localhost;
    
  2. Move the default sphinx.conf file out of the way; for example, the following will work on Linux:

    sudo mv -vi sphinx.conf sphinx.conf.dist
    
  3. Create a new sphinx.conf file in a text editor ...