17 мая 2013 г.

Use MySQL 5.6 official deb package in Debian 6

Я столкнулся с тем что при установке Mysql 5.6 не отрабатывает постинсталл скрипт и как следствие работать из пакета сервер не может.
привожу перепечатку статьи для себя и для других который могут столкнуться с этой проблемой.

Install

You need libaio-dev package.
$ sudo apt-get install libaio-dev
Make user/group of mysql.
$ sudo groupadd mysql
$ sudo useradd -r -g mysql mysql
Change owner.
$ sudo chown -R root:root /opt/mysql
$ sudo chown -R mysql:mysql /opt/mysql/server-5.6
Install mysql datadir. (See also mysql_install_db perl version has a bug?)
$ sudo install -o mysql -g mysql -d /data/mysql
$ sudo -u mysql /opt/mysql/server-5.6/scripts/mysql_install_db --user=mysql --datadir=/data/mysql
Set /etc/my.cnf and /etc/init.d/mysql.
$ sudo vi /etc/my.cnf
[mysqld]
basedir = /opt/mysql/server-5.6
datadir = /data/mysql
$ sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql
Auto start setting and start!
$ sudo update-rc.d mysql defaults
$ sudo /etc/init.d/mysql start
If you want
$ mysql_secure_installation

Path

Commands are installed on /opt/mysql/server-5.6/bin, and Manuals on /opt/mysql/server-5.6/man. You should add these path to your shell environment.
I added a file to /etc/profile.d/. This directory is read by the interactive shell.
$ sudo vi /etc/profile.d/mysql.sh 
PATH="/opt/mysql/server-5.6/bin:$PATH"
MANPATH="/opt/mysql/server-5.6/man:$MANPATH"
After that, you can use mysql_config, which tells us the collect options for compling. So I could build DBD::mysql perl module successfully.

Library

If you want to use libraries, for example libmysqlclient, you should add /opt/mysql/server-5.6/lib to library search path. Tipical way is adding a file to /etc/ld.so.conf.d/.
$ sudo vi /etc/ld.so.conf.d/mysql.conf 
/opt/mysql/server-5.6/lib
$ sudo ldconfig
You can check by ldd command.
$ ldd foo.so
        libmysqlclient.so.18 => /opt/mysql/server-5.6/lib/libmysqlclient.so.18 (0x00007f1d4acb8000)
However mysql.so konws the path because DBD::mysql build the shared object with LD_RUN_PATH="/opt/mysql/server-5.6/lib".
$ objdump -p mysql.so | grep RPATH
  RPATH                /opt/mysql/server-5.6/lib

Have fun!

It looks a bit difficult, but not too much, easier than self compling and installing, I think.

Оригинал взят с http://weblog.riywo.com/post/35522896526

Комментариев нет:

Отправить комментарий