CentOS5.6でMySQL5.5.15をソースからインストール
cmakeが必要になるのでインスコ
http://www.cmake.org/cmake/resources/software.htmlからソースをダウンロード
./bootstrap
make
make install
mysqlのインストール
WEB上のマニュアルは下記リンク
ソースを解凍した中のINSTALL-SOURCEというドキュメントの2.9章にも同様の内容が書いてある。
groupadd mysql
useradd -r -g mysql mysql
tar zxvf mysql-5.5.15.tar.gz
cd mysql-5.5.15
cmake .
(もしくは「cmake . -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci」
また、-DCMAKE_INSTALL_PREFIX=/home/taro/mysql_test などとしてインストール先を指定もできるので、検証用としてインスコできる。)make
make install
cd /usr/local/mysql
chown -R mysql.mysql
./script/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql
/etc/init.d/mysql start
/usr/local/mysql/binにパスを通す必要があるので~/.bash_profileのPATH変数を適宜修正した。
source ~/.bash_profileをお忘れなく。
/etc/my.cnfはpid-fileの部分だけ1行加えたのが下記
Example MySQL config file for medium systems.
[client]
port = 3306
socket = /tmp/mysql.sock[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
pid-file=/usr/local/mysql/data/mysqld.pid[mysqldump]
quick
max_allowed_packet = 16M[mysql]
no-auto-rehash[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M[mysqlhotcopy]
interactive-timeou
rootユーザのパスワード管理等は「./script/mysql_install_db --user=mysql」を実行した後に下記のようなコメントが出ているのでそれに沿って実施すればよい。
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OKTo start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'Alternatively you can run:
./bin/mysql_secure_installationwhich will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.plPlease report any problems with the ./bin/mysqlbug script!