当前位置:   article > 正文

mysql5.6.40部署过程

php 5.6.40 连接mysql

1.安装依赖

[root@db01 ~]# yum install -y gcc gcc-c++ automake autoconf

[root@db01 ~]# yum -y install cmake bison-devel ncurses-devel libaio-devel

2.预编译

[root@db01 ~]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.40 \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci \
> -DWITH_EXTRA_CHARSETS=all \
> -DWITH_INNOBASE_STORAGE_ENGINE=1 \
> -DWITH_FEDERATED_STORAGE_ENGINE=1 \
> -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
> -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
> -DWITH_ZLIB=bundled \
> -DWITH_SSL=bundled \
> -DENABLED_LOCAL_INFILE=1 \
> -DWITH_EMBEDDED_SERVER=1 \
> -DENABLE_DOWNLOADS=1 \
> -DWITH_DEBUG=0

3.编译&&安装

[root@db01 ~]# make && make install

4.安装后进行操作

[root@db01 ~]# useradd -s /sbin/nologin mysql -M

[root@db01 ~]# ln -s /usr/local/mysql-5.6.40/ /usr/local/mysql

[root@db01 ~]# chown -R mysql.mysql /usr/local/mysql/

5.初始化数据

[root@db01 ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

[root@db01 ~]# \cp support-files/my-default.cnf /etc/my.cnf

[root@db01 ~]# cp support-files/mysql.server /etc/init.d/mysqld

[root@db01 ~]# vim /etc/profile

export PATH=/usr/local/mysql/bin:$PATH   (文件末尾添加)

6.启动

[root@db01 ~]# /etc/init.d/mysqld start

 

转载于:https://www.cnblogs.com/fangdecheng/p/9991365.html

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号