FreeBSD 下安装Mysql

今天在FreeBSD6.2上安装了Mysql,做个笔记
1:cd /usr/ports/databases/mysql51-server/
   make WITH_XCHARSET=all WITH_CHARSET=gbk install clean
2: 出示化数据库
   cd /usr/local/bin
   mysql_install_db
3: 赋予Mysql用户对/var/db/mysql/目录以及子目录的操作权限
   chown -R mysql:mysql /var/db/mysql
4: 启动Mysql
   ./usr/local/etc/rc.d/mysql-server onestart
5: 更改root用户密码
   cd /usr/local/bin
   mysqladmin -u root password '12345'
6: 更改root用户支持远程登陆
   mysql>update user set host='%' where user='root' and host='localhost'
7: 重新启动mysql
   killall -TERM mysqld
   ./usr/local/etc/rc.d/mysql-server onestart
8: 改变rc.conf,使得Mysql自动启动
   echo mysql_enable=\"YES\">>/etc/rc.conf

  
      
  
    

你可能感兴趣的:(mysql,FreeBSD)