火曜日, 11月 10, 2009

How to install MySQL into your home directory

How to install MySQL into your home directory

# First, reserve a port number by going into the WebFaction control panel and creating a new app of type "Custom App listenting on port".

MY_PORT=PUT_THE_PORT_NUMBER_HERE

mkdir -p ~/mysql/.src
cd ~/mysql/.src/
# Download and extract the Mysql source code:
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz/from/http://mirror.services.wisc.edu/mysql/
tar xf mysql-5.0.51b.tar.gz
cd mysql-5.0.51b
./configure --prefix=$HOME/mysql
make
# Go take a 30-minute break...
make install


cat > $HOME/mysql/my.cnf << EOF
[mysqld]
port=$MY_PORT
socket=$HOME/mysql/mysql.sock
basedir=$HOME/mysql
datadir=$HOME/mysql/data

[client]
port=$MY_PORT
socket=$HOME/mysql/mysql.sock
EOF


echo export PATH=$HOME/mysql/bin:$PATH >> ~/.bash_profile
source ~/.bash_profile

mysql_install_db --basedir=$HOME/mysql --datadir=$HOME/mysql/data

# Start the MySQL Server:
cd $HOME/mysql; mysqld_safe --defaults-file=$HOME/mysql/my.cnf &

# Choose a password for root:
mysqladmin -u root password "aPasswordForRoot"


clusterのオプション指定でコンパイルする(MySQL Clusterのセットアップ
./configure –prefix=/home/mysql –with-extra-charsets=all –with-mysqld-user=mysql –enable-thread-safe-client –with-plugins=ndbcluster

0 件のコメント: