Mysql源码安装
Mysql版本:mysql-5.5.25.tar.gz
系统环境:Ubuntu11.04
更新日期:2012年6月4日
安装步骤(以下操作默认在root权限):
tar mysql-5.2.5.25.tar.gz
cd mysql-5.2.5.25
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLADKHOLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DITH_PARTITION_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DMYSQL_USER=mysql
make
make install
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /mysql
cd support-files/
cp my-medium.cnf /etc/my.cnf
chown -R root /usr/local/mysql
mkdir /usr/local/mysql/var
chown -R mysql /usr/local/mysql/var
chown -R mysql /usr/local/mysql
cd /usr/local/mysql/scripts/
./mysql_install_db –basedir=/usr/local/mysql –user=mysql –datadir=/mysql (--defaults-files= )
cd ../
cd support-files/
cp mysql.server /etc/init.d/mysqld
vi /etc/init.d/mysqld
chkconfig -add mysqld (开机启动)
server mysqld start
cp /usr/local/mysql/bin/mysql /usr/bin/mysql
/usr/local/mysql/bin/myqladmin -u root password (设置管理员密码)
mysql -uroot -p (登录测试)