Linux下安装mysql 5.0.56



1. 下载并解包
将网络下载的mysql-5.0.56.tar.gz文件放在/usr/local/src目录并解包

#cd /usr/local/src
#tar xzvf mysql-5.0.56.tar.gz
#cd mysql-5.0.56

2. 编译安装

#./configure
–prefix=/usr/local/mysql
–localstatedir=/var/lib/mysql
–with-comment=Source
–with-server-suffix=-enterprise-gpl
–with-mysqld-user=mysql
–without-debug
–with-big-tables
–with-charset=utf8
–with-collation=utf8_general_ci
–with-extra-charsets=all
–with-pthread
–enable-static
–enable-thread-safe-client
–with-client-ldflags=-all-static
–with-mysqld-ldflags=-all-static
–enable-assembler
–without-innodb
–without-ndb-debug
–without-isam
–enable-local-infile
–with-readline
–with-raid
如果编译成功,你会看到:Thank you for choosing MySQL!

#make
在此过程中遇到”/usr/bin/ld: cannot find -lncurses”错误,安装libncurses5-dev包后再次编译正常。

#make install
安装完成

3. MYSQL配置
#groupadd mysql
#useradd -g mysql -s /bin/false -M mysql
#cd /usr/local/mysql
#bin/mysql_install_db –user=mysql
安装MYSQL系统表

Installing MySQL system tables…
OK
Filling help tables…
OK
……

设置目录文件权限
#chown -R root:mysql .
#chown -R mysql /var/lib/mysql
#chgrp -R mysql .
#cp share/mysql/my-medium.cnf /etc/my.cnf
#cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
#chmod 755 /etc/rc.d/init.d/mysqld

加入自动启动服务队列
# chkconfig –add mysqld

配置库文件搜索路径
#echo “/usr/local/mysql/lib” >> /etc/ld.so.conf && ldconfig

开启或关闭mysqld服务
/etc/rc.d/init.d/mysqld start/stop
service mysqld start/stop

修改root初始密码
bin/mysqladmin -u root password “your password”

4. 安装完成



发表评论