Cmake for MySQL compilation and Installation

Source: Internet
Author: User
The software cmake is required for mysql version 5.5 and later compilation and installation. The cmake feature is independent from the source code compilation. The compilation can be performed in another directory instead of the source code directory,

The software cmake is required for mysql version 5.5 and later compilation and installation. The cmake feature is independent from the source code compilation. The compilation can be performed in another directory instead of the source code directory,

The software cmake is required for mysql version 5.5 and later compilation and installation. The cmake feature is independent from the source code compilation. The compilation can be performed in another directory instead of the source code directory, the advantage is that the source code directory is not affected by any compilation.
1. Download and install cmake

[Root @ linuxidc ~] # Wget
[Root @ linuxidc ~] # Tar zxvf cmake-2.8.11.2.tar.gz
[Root @ linuxidc ~] # Cd cmake-2.8.11.2
[Root @ linuxidc ~] #./Bootstrap
[Root @ linuxidc ~] # Make & make install

Cmake Installation Complete
2. Install MySQL or a later version.

[Root @ linuxidc ~] # Wget: // cdn.mysql.com/
[Root @ linuxidc ~] # Tar zxvf mysql-5.6.13.tar.gz
[Root @ linuxidc ~] # Cd mysql-5.6.13
[Root @ linuxidc ~] # Cmake-DCMAKE_INSTALL_PREFIX =/opt/mysql-DMYSQL_UNIX_ADDR =/tmp/mysql. sock-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-frequency = all-rows = 1-rows = 1-rows = 1-rows = 1-DWITH_SSL = yes-DENABLED_LOCAL_INFILE = 1

3. settings after mysql Installation
1. Modify permissions

[Root @ linuxidc ~] # Chown-R root. mysql/opt/mysql/
[Root @ linuxidc ~] # Chown-R mysql. mysql/opt/mysql/data/


2. initialize the database
[Root @ linuxidc ~] #/Opt/mysql/scripts/mysql_install_db -- user = mysql
Fatal error: cocould not find./bin/my_print_defaults
If you compiled from source, you need to run 'make install'
Copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
Level of the extracted archive, or pass the -- basedir option
Pointing to that location.
# This error occurs during initialization because the installation directory and data directory are not specified,

[Root @ linuxidc ~] #/Opt/mysql/scripts/mysql_install_db -- user = mysql -- basedir =/opt/mysql/-- datadir =/opt/mysql/data/

3. Copy the configuration file my. cnf.

[Root @ linuxidc ~] # Cp/opt/mysql/support-files/my-default.cnf/etc/my. cnf

4. Start
[Root @ linuxidc ~] #/Opt/mysql/bin/mysqld_safe &
[1] 18401
[Root @ linuxidc ~] #130909 23:28:07 mysqld_safe Logging to '/opt/mysql/data/linuxidc. err '.
130909 23:28:07 mysqld_safe Starting mysqld daemon with databases from/opt/mysql/data
[Root @ linuxidc ~] # Ps-ef | grep mysql
Root 18401 22774 2 00:00:00 pts/0/bin/sh/opt/mysql/bin/mysqld_safe
Mysql 18491 18401 81 00:00:03 pts/0/opt/mysql/bin/mysqld -- basedir =/opt/mysql -- datadir =/opt/mysql/data -- plugin-dir =/opt /mysql/lib/plugin -- user = mysql -- log-error =/opt/mysql/data/linuxidc. err -- pid-file =/opt/mysql/data/linuxidc. pid
Root 18515 18245 0 00:00:00 pts/2 grep mysql

Detailed description of cmake compilation parameters:
-DCMAKE_INSTALL_PREFIX = dir_name: used to specify the installation directory
-DWITH_INNOBASE_STORAGE_ENGINE = 1
-DWITH_ARCHIVE_STORAGE_ENGINE = 1
-DWITH_BLACKHOLE_STORAGE_ENGINE = 1
-DWITH_PERFSCHEMA_STORAGE_ENGINE = 1: common storage engine parameter settings

-DDEFAULT_CHARSET = charset_name
The server character set. By default, MySQL uses the latin1 (cp1252 West European) character set.
Charset_name may be one of binary, armscii8, ascii, big5, cp1250, cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, eucjpms, euckr, gb2312, gbk, keys, greek, hebrew, hp8, keybcs2, keys, keys, latin1, latin2, latin5, latin7, macce, macroman, sjis, swe7, tis620, ucs2, ujis, utf8, utf8mb4, utf16, utf16le, utf32. The permissible character sets are listed in the cmake/character_sets.cmake file as the value of CHARSETS_AVAILABLE.
-DENABLED_LOCAL_INFILE = bool: bool value (1 indicates that this function is allowed, and 0 indicates that the function is not changed)

-DMYSQL_UNIX_ADDR = file_name
The Unix socket file path on which the server listens for socket connections. This must be an absolute path name. The default is/tmp/mysql. sock.

Related reading:

Compile and install MySQL 5.5 Based on Cmake

Installing mysql-5.5.10 in Cmake Mode

Install MySQL 5.5.13 Cmake in CentOS

Install MySQL 5.6.12 (Cmake compilation) in Linux source code)

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.