Install and configure MySQL-Proxy in Linux

Source: Internet
Author: User

The installation of the MySQL-Proxy binary version is relatively simple, and does not need to be repeated. The following describes how to install the source code for Linux:

Install pkg-config:

Tar zxvf pkg-config-0.23.tar.gz

Cd pkg-config-0.23

./Configure

Make

Make install

Make sure that the PKG_CONFIG_PATH environment variable contains the relevant pkg-config configuration file path:

Export PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

Install libevent:

Tar zxvf libevent-1.4.10-stable.tar.gz

Cd libevent-1.4.10-stable

./Configure

Make

Make install

Install glib:

Tar zxvf glib-2.20.0.tar.gz

Cd glib-2.20.0

./Configure

Make

Make install

Install lua:

Tar zxvf lua-5.1.4.tar.gz

Cd lua-5.1.4

If your server is 64-bit, adjust Makefile: vi src/Makefile and add-fPIC to CFLAGS; otherwise, an error occurs:

/Usr/bin/ld:/usr/local/lib/liblua. a (lapi. o ):

Relocation R_X86_64_32 against 'luao _ nilobject _ 'can not be used when making a shared object;

Recompile with-fPIC

/Usr/local/lib/liblua. a: cocould not read symbols: Bad value

Next, you do not need to execute common configure, and make directly:

Make linux

Make install

Install the pkg-config configuration file so that lua can be found when mysql-proxy is compiled:

Cp etc/lua. pc/usr/local/lib/pkgconfig/lua5.1.pc

If you do not perform this step, you will get an error message similar to the following when compiling and installing mysql-proxy later:

Package lua5.1 was not found in the pkg-config search path.

Perhaps you shoshould add the directory containing 'lua5. 1. pc'

To the PKG_CONFIG_PATH environment variable

No package 'lua5. 1' found

Install mysql:

Here we will introduce the complete installation of mysql. In fact, you only need to install the mysql development kit.

Tar zxvf mysql-5.1.33.tar.gz

Mysql-5.1.33 for cd tar zxvf

./Configure

Make

Make install

Cp support-files/mysql. server/etc/init. d/mysql

Chown + x/etc/init. d/mysql

Cp support-files/my-[small | medium | large | huge | innodb-heavy-4G]. cnf/etc/my. cnf

If the skip-federated option exists in my. cnf, comment it out. Otherwise, an error similar to the following occurs during database installation:

[ERROR]/usr/local/libexec/mysqld: unknown option '-- skip-federated'

/Usr/local/bin/mysql_install_db -- user = mysql

/Usr/local/bin/mysqld_safe -- user = mysql &

Ensure that the system can find mysql_config, which will be used in mysql-proxy compilation later:

Export PATH = $ PATH:/usr/local/bin

Make sure that the system can find the mysql database file:

Add vi/etc/ld. so. conf to the/usr/local/lib directory.

Run:/sbin/ldconfig/etc/ld. so. conf

  • 1
  • 2
  • Next Page

Related Article

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.