FreeBSD如何使用ports安装MySQL

[ 2007/09/25 22:25 | by Johnny.He ]
| |
wwwer.org.cn现在更改成了FreeBSD的系统了,今天安装MySQL的时候发现以前的安装方法存在一些问题,现在记录下来如何如何使用ports安装,方法如下:
------------------------------------------------
cd /usr/ports/databases/mysql50-server
make install clean;
/usr/local/bin/mysql_install_db
chown -R mysql /var/db/mysql
#这一步一定不能少,否则mysql将启动不起来

#启动mysql
/usr/local/bin/mysqld_safe &
#或者/usr/local/etc/rc.d/mysql-server.sh start

/usr/local/bin/mysqladmin -u root password '123456'
#一定要做这个,否则不安全的
rehash
mysql -u root -p
Enter password:  
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.24

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>; exit
Bye

在/etc/rc.conf里面加入mysql_enable="YES"
一本便利 » Database|SQL | 评论(0) | 引用(0) | 阅读(885)
发表评论
昵称 [注册]
密码 游客无需密码
网址
电邮
打开HTML 打开UBB 打开表情 隐藏 记住我