以下是以5.4-RELEASE-p6+mysql-4.0.25为例
cd /usr/ports/databases/mysql40-server
make install clean;
/usr/local/bin/mysql_install_db
chown -R mysql /var/db/mysql
##这一步一定不能少,否则mysql将启动不起来
启动mysql
/usr/local/bin/mysqld_safe &
或者/usr/local/etc/rc.d/mysql-server.sh start
/usr/local/bin/mysqladmin -u root password ‘123456′
#一定要做这个,否则不安全的。