Freebsd7.0下mysql安装笔记

以下内容为根据视频内容做的笔记:

先安装ports,建议ports为最新,不是最新的可以使用portsnap,cvsup,Portmanager或者portupgrade工具进行更新

准备=======================================================

#cd /usr/ports/databases/mysql50-server
#pwd
#make    //时间很长

#make install //安装

#make clean //清除安装过程中产生的临时文件,以节省硬盘空间

或者使用以上三条命令的组合:
#make WITH_XCHARSET=all WITH-CHARSET=utf8 WITH_PROC_SCOPE_PTH=yes SKIP_DNS_CHECK=yes BUILD_OPTIMIZED=yes install clean

安装============================================
#cd /usr/ports/databases/mysql50-server
#pwd
#make
配置============================================

-R 包含目录下的所有目录及文件

#mysql_install_db
#chown -R mysql /var/db/mysql
#chgrp -R mysql /var/db/mysql

#/usr/local/bin/mysqld_safe --user=mysql &   //使用&以后台启用,方便检测进程是否正常

检查安装============================================
#ps -ef|grep mysqld

#netstat -an | grep 3306  检测
#mysql //连接mysql
#show databases //

高级配置============================================

设为系统启用服务
#echo 'mysql_enable="YES"'>>/etc/rc.conf

MySQL优化============================================

mysql优化
#ls /usr/local/share/mysql/*.cnf
#cp /usr/local/share/mysql/my-medium.cnf   /var/db/mysql/my.cnf

Leave a Reply

Your email address will not be published.