BSD,PORTS安装mysql

下面贴出我安装的方法。
#cd /usr/ports/databases/mysql51-server
#make WITH_CHARSET=gbk WITH_XCHARSET=all WITH_PROC_SCOPE_PTH=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes SKIP_DNS_CHECK=yes WITHOUT_INNODB=yes install clean
#rehash;rehash;rehash;
#cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf

#设置随机启动:
vi /etc/rc.conf
mysql_enable="YES"

#初始化:
/usr/local/bin/mysql_install_db --user=mysql
#更改数据库权限(若所有者不是mysql):
chown -R mysql /var/db/mysql/
#立即启动:
/usr/local/bin/mysqld_safe -user=mysql &
修改密码
#/usr/local/bin/mysqladmin -u root password 'newpasswd'
就好了,
#mysql -u root 进入看看,
#show databases;
#mysqladmin shutdown 关掉mysql,并退出;
 

chown -R mysql /var/db/mysql/  不容马虎

 

你可能感兴趣的:(BSD,PORTS安装mysql)