中国网管论坛's Archiver

清心 发表于 2006-12-25 11:22

Mysql 编译安装 for FreeBSD

Mysql 编译安装 for FreeBSD 系统平台: freebsd 6.1 stable
mysql5.0.27
来源:[url=http://www.prowork.com.cn]http://www.prowork.com.cn[/url]

下载地址:

[url=http://dev.mysql.com/downloads/mysql/5.0.html][color=#800080]http://dev.mysql.com/downloads/mysql/5.0.html[/color][/url]

注意选择最下面的那个



代码:Source downloads

For maximum stability and performance, we recommend that you use the binaries we provide



[b][size=18px]内容:[/size][/b]

[b]编译安装[/b]

./configure --prefix=/usr/local/mysql --sysconfdir=/usr/local/etc --localstatedir=/data/mysql
--prefix=/usr/local/mysql \\ 程序目录
--localstatedir=/data/mysq \\ 数据库存放目录
--sysconfdir=/usr/local/mysql/etc \\my.cnf 配置文件目录
Make \\ 编译
Make install \\ 安装

[b]初始化数据库[/b]

server# ./usr/local/mysql/bin/mysql_install_db
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h server.cnhacker.com password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/local/mysql/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
[url=http://www.mysql.com/][color=#800080]http://www.mysql.com[/color][/url]
Support MySQL by buying support/licenses at [url=http://shop.mysql.com/][color=#0000ff]http://shop.mysql.com[/color][/url]

\\ 这里有几点很重要的信息!


[b]建立目录[/b]

Mkdir /usr/local/mysql/etc \\ 存储配置文件
Mkdir /data/mysql \\ 数据库存放目录

[b]设定权限(两处)[/b]

chown -R root /usr/local/mysql
chgrp -R mysql /usr/local/mysql
chown -R mysql /data/mysql
chgrp –R mysql /data/mysql

[b]拷贝管理脚本[/b]

Cd /usr/local/mysql/bin
Cp mysql /usr/sbin
Cp mysqladmin /usr/sbin
Cp mysqld_safe /usr/sbin
Rehash

[b]拷贝配置文件[/b]

Cd /usr/local/mysql/share/mysql
Cp my-huge.cnf ../../etc/my.cnf

[b]启动与停止[/b]

Mysqld_safe &
Mysqladmin shutdown

[b]设定自启动[/b]

cp mysql.server /usr/local/etc/rc.d/mysql.server.sh
chmod 777 mysql.server.sh
/bin/sh /etc/rc \\ 验证是否可以自启动
Starting sshd.
Starting cron.
Local package initialization:/usr/local/etc/rc.d/httpd.sh start: httpd (pid 9600) already running
Starting MySQL SUCCESS! \\ 显示成功

[b]安全与配置[/b]

省略

风随缘 发表于 2006-12-27 01:29

煾 不错
继续 努力

aming1983 发表于 2008-9-26 12:27

不错~顶起来

blueralf 发表于 2008-9-27 10:26

非常好。。等好久了

页: [1]

Powered by Discuz! Archiver 6.1.0  © 1999-2008 bbs.bitsCN.com