step 1)下载源代码包到本地Linux主机,然后解压缩,进入该目录,进行配置,编译和安装
下载mysql5源码mysql-5.0.18.tar.gz到目录/usr/local
cd /usr/local
tar xzvf mysql-5.0.18.tar.gz
cd mysql-5.0.18
./configure --prefix=/usr/local/mysql
make && make install
make过程花的时间比较长
step 2)配置
cp support-files/my-medium.cnf /etc/my.cnf
vi /etc/my.cnf 加入以下两行并保存
log-error=/var/lib/mysql/data/x.err
datadir= /var/lib/mysql/data
cd /usr/local/mysql
bin/mysql(可能会抱错Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) )
然后
scripts/mysql_install_db --user=mysql
bin/mysqld_safe
再
/usr/local/mysql/bin/mysql就ok了
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
分享到:
2007-03-07 17:32
浏览 599
评论