mysql5.58_mysql5.58 install

mysql 5.5 安装部署

mysql5.5放弃了原来的autoconf编译方式,改用cmake。

1.先下载cmake

http://www.cmake.org

编译安装./configure;make;make install

2.解压mysql,然后进入mysql包目录:

文档说有三个参数:

* -DBUILD_CONFIG=mysql_release: Configure the source with the

same build options used by Oracle to produce binary

distributions for official MySQL releases.

* -DCMAKE_INSTALL_PREFIX=dir_name: Configure the distribution

for installation under a particular location.

* -DCPACK_MONOLITHIC_INSTALL=1: Cause make package to generate a

single installation file rather than multiple files.

* -DWITH_DEBUG=1: Build the distribution with debugging support.

我只指定了prefix:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql .

make

make install

安装完毕

cp /root/mysql/support-files/my-large.cnf /etc/my.cnf

cp /root/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld

修改/etc/rc.d/init.d/mysqld

basedir=/usr/local/mysql

datadir=/home/mysql/data(例如你的数据目录在/home/mysql/下)

到你准备生成mysqldatadir的目录里执行:/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql

启动mysql:/usr/local/mysql/bin/mysqld_safe --user=mysql &

设置密码

mysqladmin -u root password 'yourpass'

mysql -u root

flush privileges;

设置系统级别3的时候,自动启动mysqld

chkconfig --level 3 mysqld on

设置环境变量

# PATH=$PATH:/usr/local/mysql/bin

# export PATH

# echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf

# ldconfig

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值