mysql二进制文件编译_二进制编译安装mysql

1:解压包及做链接 # tar xvf mysql-5.5.13-linux2.6-i686.tar.gz -C /usr/local # cd /usr/local # ln -sv mysql-5.5.13-linux2.6-i686 mysql # cd mysql --------------------------------------------------------------- 2:增加用户mysql及创建数据库数据存放目录/mydata/data # groupadd mysql # useradd -g mysql -s /sbin/nologin -M -r mysql # mkdir /mydata # cd /mydata # mkdir data # chown -R mysql:mysql /mydata ---------------------------------------------------------------- 3:初始化mysql的配置 # cd /usr/local/mysql # chown mysql:mysql . -R # scripts/mysql_install_db --user=mysql --datadir=/mydata/data # chown root . -R # cp support-files/my-large.cnf /etc/my.cnf # vim /etc/my.cnf ---------------------------------------------------------------- ## 在[mysqld]的字段添加如下一行: ---------------------------------------------------------------- datadir = /mydata/data ---------------------------------------------------------------- 4:启动mysql # cd /usr/local/mysql # bin/mysqld_safe --user=mysql & # netstat -nutlp |grep '3306' ---------------------------------------------------------------- 5:设置系统使其拥有mysql命令 # vim /etc/profile ---------------------------------------------------------------- ##最好在export字段其上添加一行: ---------------------------------------------------------------- PATH=$PATH:/usr/local/mysql/bin ---------------------------------------------------------------- # . /etc/profile ---------------------------------------------------------------- 6:加载库函数 # cd /etc/ld.so.conf.d/ # vim mysql.conf ---------------------------------------------------------------- 添加如下一行: ---------------------------------------------------------------- /usr/local/mysql/lib ---------------------------------------------------------------- # ldconfig -v # ln -sv /usr/local/mysql/include  /usr/include/mysql # ls /usr/include/mysql ---------------------------------------------------------------- 7:把mysql加入开机启动 # cd /usr/local/mysql # cp support-files/mysql.server  /etc/init.d/mysqld # chkconfig --add mysqld # chkconfig mysqld on # service mysqld start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值