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! // 显示成功
安全与配置
省略