源码安装MySQL 5.5.14到个人目录


MySQL-5.5.14使用cmake安装,已经不需要./configure了。如果要安装到个人目录,cmake时需指定路径。启动时,.my.cnf也要指定。

cmake . -DCMAKE_INSTALL_PREFIX=$HOME/mysql-5.5.14
make
make install
cd $HOME
ln -sv mysql-5.5.14 mysql
cd mysql
cp support-files/my-medium.cnf $HOME/.my.cnf
(edit .my.cnf to change the socket parameter)
./scripts/mysql_install_db --defaults-file=$HOME/.my.cnf
./bin/mysqld_safe --defaults-file=$HOME/.my.cnf &
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h <your-hostname> password 'new-password'

相关内容