The 64-bit CentOS6.3 system is installed with a minimal package. It is used as a local Web server and the entire process is recorded.
Step 6: Install mysql5.5 database v5.5.28
Mysql starts from Version 5.5 and does not use./configure for compilation. Instead, it uses the cmake compiler. For specific cmake compilation parameters, refer to the mysql official website documentation (※very important)
Http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html
Source code package mysql-5.5.28.tar.gz:
Http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28.tar.gz
My mysql directory configuration is as follows:
Installation path:/usr/local/mysql
Database path:/data/mysql
Source code package storage location:/usr/software
Preparation: Install the basic dependency package. First install cmake, automake, and autoconf with yum. Also, the minimum packages required for MySQL 5.5.x include bison, gcc, gcc-c ++, and ncurses-devel.
[Root @ localhost ~] # Yum install cmake make-y
[Root @ localhost ~] # Yum install 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
Start compilation and Installation
[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. 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
Brief translation of mysql official website English documents
The MyISAM, MERGE, MEMORY, and CSV engines are mandatory (always compiled into the server) and need not be installed explicitly. (Note: by default, mysql supports the following database engines: MyISAM, MERGE, MEMORY, and CSV. You do not need to declare them during compilation)
Therefore, the preceding compilation condition saves the following two rows:
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_MEMORY_STORAGE_ENGINE = 1 \
However, INNODB must be installed in declarative mode.
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
Check whether mysql. mysql users and groups exist.