Gcc:/usr/lib/mysql/libmysqlclient. so: No such file or directory --- MySQL compilation [database technology]

Source: Internet
Author: User

Linux has been quite depressing recently. The following article is very helpful, in red ~

 

Recently, the mmm architecture of MySQL has been launched, and I want to make a try. I think there is a virtual IP address like LVS in it. I started to use yum for MySQL and found that Yum,/etc/My. CNF is very ugly. You can't download the latest source code package to compile and install it. The result is that the problem comes one after another. It doesn't matter. The main problem was the issue of Yum install PHP-mysql. Later I found that the compilation was complete, and then I went to the rpm-IVH mysql-devel version, mysql-shared solves the problem, so there will be no different MySQL component versions.

Install: mysql-5.1.52.tar.gz to http://mysql.ntu.edu.tw/Downloads/MySQL-5.1/ download a: MySQL-devel-5.1.52-1.glibc23.i386.rpm (install this to solve issues like yum install PHP-MySQL ), download and install a MySQL-shared-5.1.52-1.glibc23.i386.rpm (this will be used when compiling PHP ). If the following error is not displayed: GCC:/usr/lib/MySQL/libmysqlclient. So: no such file or directory.
Download MySQL-shared-5.1.52-1.glibc23.i386.rpm
Ln-S/usr/lib/libmysqlclient. So/usr/lib/MySQL/libmysqlclient. So is OK.

Yum-y install NTP
Ntpdate time.nist.gov

VI/etc/lD. So. conf
Add/usr/lib
Ldconfig

Mkdir-P/data/MySQL/Data
Groupadd mysql
Useradd-g mysql-d/data/mysql-s/sbin/nologin mysql
Chown-R mysql. mysql/data/mysql

[Root @ Master ~] # Tar-zxvf mysql-5.1.52.tar.gz

./Configure/
-- Prefix =/usr/local/mysql //
-- Localstatedir =/data/mysql/data/
-- With-mysqld-user = mysql/
-- Enable-Cycler/
-- Without-debug/
-- With-extra-charsets = complex/
-- With-big-tables/
-- With-readline/
-- With-ssl/
-- Enable-local-infile/
-- Enable-thread-safe-client/
-- With-client-ldflags =-all-static/
-- With-mysqld-ldflags =-all-static/
-- With-plugins = partition, innobase, myisammrg

Make & make install

Chown-R mysql. mysql/usr/local/mysql
CP support-files/my-huge.cnf/etc/My. CNF
/Usr/local/MySQL/bin/mysql_install_db -- user = MySQL

CP support-files/MySQL. Server/etc/init. d/mysqld
Chmod 755/etc/init. d/mysqld

Chkconfig -- add mysqld

CD/usr/local/MySQL/bin
For I in *; do ln-S/usr/local/MySQL/bin/$ I/usr/bin/$ I; done/becomes the system environment variable

Mysqladmin-uroot-P password 123456/modify the root password

From: http://www.vpsa.net /? Post = 43

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.