Mysql 编译安装 【FreeBSD】

 MySQL5.5编译工具configure向cmake过渡指南

看『http://blog.csdn.net/yjj1s/archive/2011/05/15/6422142.aspx

 

【转http://bbs.bitscn.com/72492】

 

编译安装

./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 // 安装

初始化数据库

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
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com

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


建立目录

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

设定权限(两处)

chown -R root:mysql /usr/local/mysql

chown -R mysql:mysql /data/mysql
#chgrp -R mysql /usr/local/mysql
#chgrp –R mysql /data/mysql

拷贝管理脚本

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

拷贝配置文件

Cd /usr/local/share/mysql

Cp my-huge.cnf ../../etc/my.cnf

启动与停止

Mysqld_safe &
Mysqladmin shutdown

设定自启动

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! // 显示成功

安全与配置

省略

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值