作者xunlu (xunlu)
看板FreeBSD
标题Re: [问题] 使用ports方式安装 Apache MySQL PHP FTP
时间Tue Mar 31 16:06:51 2009
※ 引述《starlition (unknown)》之铭言:
: ※ 引述《xunlu (xunlu)》之铭言:
: : xl# pwd
: : /usr/ports/databases/mysql51-server
: : make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_unicode_ci
: : BUILD_OPTIMIZED=yes install clean
: : 这两个我没打勾
: : │ │ [ ] EXTRA_ENCODINGS Include extra character sets
: : │ │ [ ] EXTRA_PATCHES Apply patches to fix CP932 add EUCJP-MS
: : 请问接下来我该如何启动与设定呢?
: : 谢谢
: : BTW:
: : 使用package安装与ports安装时间真的是天和地 ports超久的 > <
: 如果安装的是 daemon 类的程式的话
: 通常装完以後 /usr/local/etc/rc.d 下面会有增加一些东西
: 去 cat 那个东西
: 例如: cat /usr/local/etc/rc.d/mysql-server
: 会看到里面有
: #
: # Add the following line to /etc/rc.conf to enable mysql:
: # mysql_enable (bool): Set to "NO" by default.
: # Set it to "YES" to enable MySQL.
: # mysql_limits (bool): Set to "NO" by default.
: # Set it to yes to run `limits -e -U mysql`
: # just before mysql starts.
: # mysql_dbdir (str): Default to "/var/db/mysql"
: # Base database directory.
: # mysql_args (str): Custom additional arguments to be passed
: # to mysqld_safe (default empty).
: #
: 所以把 /etc/rc.conf 里面加入 mysql_enable="YES" 就好
: (要修改其他的设定也可以参考上面的预设值同时设定)
: 然後执行 /usr/local/etc/rc.d/mysql-server start
: 相同的停止的话 把 start 换成 stop
: 重跑的话 把start 改成 restart
: 就可以了
感谢您 服务有启动了
第一阶段整理如下
若有遗漏的地方烦请告知我继续试着安装apache
BTW:我在网站上看到这行
# mysqladmin -u root password 新密码
请问若不执行此行那预设密码为何呢?
安装mysql
# /usr/ports/databases/mysql51-server
make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_unicode_ci
BUILD_OPTIMIZED=yes install clean
这两个我没打勾
│ │ [ ] EXTRA_ENCODINGS Include extra character sets
│ │ [ ] EXTRA_PATCHES Apply patches to fix CP932 add EUCJP-MS
复制 MySQL 的系统设定档到 /etc 下
# cp /usr/local/share/mysql/my-xxx.cnf /etc/my.cnf
注:
/usr/local/share/mysql/下一共有5个cnf档,分别对应不同记忆体大小的伺服器
my-small.cnf 最小配置安装,记忆体<=64m,资料数量最少
my-large.cnf 记忆体=512m
my-medium.cnf 32m<记忆体<64m,或者记忆体有128m,但是资料库与web伺服器公用记忆
体
my-huge.cnf 1g<记忆体<2g,伺服器主要运行mysql
my-innodb-heavy-4g.cnf 最大配置安装,记忆体至少4g
# ee /etc/rc.conf
里面加入 mysql_enable="YES"
启动
#/usr/local/etc/rc.d/mysql-server start
#netstat -an
看看是否有多个3306 若有就是执行成功
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.133.5.175