2015年6月17日水曜日

MySQLについてくるautomysqlbackupの使い方

MySQLにはバックアップ専用にautomysqlbackupがついてくるので、ちょっと使い方についてメモ書き。


  1. sudo apt-get install automysqlbackup でインストール
  2. /var/lib/automysqlbackup にバックアップが毎日作られるが、スクリプト中で保存先は指定できる。
※ BACKUPDIRとDBNAMESぐらいかな、変更したのは。。




https://serverpilot.io/community/articles/how-to-back-up-mysql-databases-with-automysqlbackup.html

MySQL 5.1 をUbuntu 12.04にインストールする方法

MySQL5.1をUbuntu12.04にインストールしようと思ったら、apt-getでは5.5がインストールされてしまうので、ソースからMySQL5.1をインストールするのに以下を参考にした。

シェルスクリプトでもコマンドラインからでもOK。

#!/bin/bash

set -e

cd ~/
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz
tar -zxf mysql-5.1.65.tar.gz
cd mysql-5.1.65
./configure  '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control'
make
sudo make install


参考
http://askubuntu.com/questions/125686/failed-to-spawn-mysql-main-process-unable-to-execute-no-such-file-or-director