Top

Mysql-Install

Mysql的安装

2.1 安装相关依赖

[root@server httpd-2.4.38]# yum install cmake make ncurses-devel ncurses git perl-Module-Install -y

2.2 下载源码包并解压

[root@server httpd-2.4.38]# cd /usr/src/
[root@server src]# wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.43.tar.gz
[root@server src]# tar xf mysql-5.6.43.tar.gz
[root@server src]# cd mysql-5.6.43

2.3 编译并安装

[root@server mysql-5.6.43]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql55/ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DWITH_XTRADB_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DWITH_EXTRA_CHARSETS=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_BIG_TABLES=1 -DWITH_DEBUG=0
[root@server mysql-5.6.43]# make -j4 && make -j4 install
[root@server mysql-5.6.43]# cp support-files/my-default.cnf /etc/my.cnf
[root@server mysql-5.6.43]# ln -s /usr/local/mysql55/bin/* /usr/bin/
[root@server mysql-5.6.43]# mkdir -p  /data/mysql
[root@server mysql-5.6.43]# useradd  mysql
[root@server mysql-5.6.43]# /usr/local/mysql55/scripts/mysql_install_db --user=mysql --datadir=/data/mysql/ --basedir=/usr/local/mysql55/
[root@server mysql-5.6.43]# cp support-files/mysql.server /etc/init.d/mysqld && chmod 755  /etc/init.d/mysqld
[root@server mysql-5.6.43]# /etc/init.d/mysqld restart


        
 上一篇

  Centos, Mysql