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:
在/etc/rc.conf里面加入mysql_enable="YES"
------------------------------------------------
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
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"



