分类: BSD
2008-09-06 18:15:03
操作系统 freebsd7.1 mysql
1安装操作系统
选择最小安装 src ports
2安装cvsup-withou-gui
Cd/usr/ports/net/cvsup-without-gui/
3更新ports 和源码
Cvsup –g –L 2 stable-superfile 和ports-superfile
4 添加用户
pw groupadd mysql
Pw useradd mysql –g mysql
5安装mysql
/usr/ports/databases/mysql51-server
编辑Makefile 修改下方
CONFIGURE_ARGS= --localstatedir=/data/mysql \
--without-debug \
--without-readline \
--without-libedit \
--with-libwrap \
--with-mysqlfs \
--with-comment='FreeBSD port: ${PKGNAME}' \
--enable-thread-safe-client \
--enable-assembler \
--with-extra-charsets=gbk,gb2312,utf8 \ 任意一个语言
这个可以许需要 --with-named-thread-libs='-lthr' \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static
6 设置mysql 自己启动
在rc.conf添加
Mysql_enable=”yes”
7修改mysql 密码
输入mysql –u root –p
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
mysqladmin -u root -p password mypasswd 提示如下问题
ERROR 1133 (42000): Can't find any matching row in the user table
按如下方法修改密码
use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
成功
登录 mysql –u root –p
修改匿名用户的密码
SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd');
SET PASSWORD FOR = PASSWORD('newpwd');
修改这两个匿名连接
授权访问 远程ip地址访问
grant all on *.* to crastyl@'