FreeBSD 7.2下安装MySql4.0

采用FreeBSD提供的ports安装

第1步

# cd /usr/ports/databases/mysql40-server/

第2步

#make install

 

根据你的网络速度情况,可能要等10多分钟

...

 

第3步:安装数据库

# /usr/local/bin/mysql_install_db     

 

第4步:

#chown -R mysql /var/db/mysql

 

第5步:启动mysql 
#/usr/local/bin/mysqld_safe &

 

第6步:设置root用户密码

#/usr/local/bin/mysqladmin -u root password '123456'

 

第7步:登录测试一下root用户

#mysql -u root -p

 

第8步:设置mysql在系统启动时自动启动

#vi /etc/rc.conf

按a键在最后加上:

mysql_enable="YES"

例如我的配置文件:

# Created: Mon Apr 19 19:36:56 2010
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="192.168.192.1"
hostname="Squid_CA.NIC"
ifconfig_le0="inet 192.168.192.33  netmask 255.255.255.0"
keymap="us.iso"
linux_enable="YES"
sshd_enable="YES"
mysql_enable="YES"

猜你喜欢

转载自mixer-a.iteye.com/blog/1497185