Home > Database > Mysql Tutorial > CentOS6.3源码安装mysql5.5.28

CentOS6.3源码安装mysql5.5.28

PHPz
Release: 2019-02-26 16:53:54
Original
1280 people have browsed it

mysql从5.5版本开始,不再使用./configure编译,而是使用cmake编译器,具体的cmake编译参数可以参考mysql官网文档(※ 非常重要)

相关mysql视频教程推荐:《mysql教程

全新以最小化包安装了64位的CentOS6.3系统,,作为本地的Web服务器使用,现记录全过程
第六步,安装mysql5.5数据库v5.5.28

mysql从5.5版本开始,不再使用./configure编译,而是使用cmake编译器,具体的cmake编译参数可以参考mysql官网文档(※ 非常重要)

mysql-5.5.28.tar.gz源码包下载地址:

我的mysql目录配置如下:
安装路径:/usr/local/mysql
数据库路径:/data/mysql
源码包存放位置:/usr/software

准备工作:安装基本依赖包,先用yum安装cmake、automake 、autoconf ,另MySQL 5.5.x需要最少安装的包有:bison,gcc、gcc-c++、ncurses-devel

[root@localhost ~]# yum install cmake make -y
[root@localhost ~]# yum install gcc gcc-c++ autoconf bison automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* -y
[root@localhost ~]# cp /root/mysql-5.5.28.tar.gz /usr/software/
[root@localhost ~]# cd /usr/software
开始编译安装
[root@localhost ~]# tar -zxvf mysql-5.5.28.tar.gz
[root@localhost ~]# cd mysql-5.5.28
[root@localhost ~]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
        -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \
        -DDEFAULT_CHARSET=utf8 \
        -DDEFAULT_COLLATION=utf8_general_ci \
        -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
        -DWITH_INNOBASE_STORAGE_ENGINE=1 \
        -DWITH_READLINE=1 \
        -DENABLED_LOCAL_INFILE=1 \
        -DMYSQL_DATADIR=/data/mysql/ \
        -DMYSQL_USER=mysql \
        -DMYSQL_TCP_PORT=3306
[root@localhost ~]# make && make install
Copy after login

mysql官网英文文档简单翻译说明一下

The MyISAM, MERGE, MEMORY, and CSV engines are mandatory (always compiled into the server) and need not be installed explicitly.

(说明:mysql默认支持的数据库引擎有MyISAM, MERGE, MEMORY, CSV,无需在编译时再声明)
所以上面的编译条件省掉了如下两行

-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
但INNODB一定要声明式安装,所以多了这一行
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
Copy after login

查看mysql.mysql的用户及组是否存在

Related labels:
ce
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template