Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed process of MySQL5.6.12 source code installation under Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "the detailed process of installing MySQL5.6.12 source code under Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "the detailed process of installing MySQL5.6.12 source code under Linux".

1. Description before installation

Essential bags and tools

Gcc/g++: starting with MySQL 5. 6, you need to compile with MySQL +.

Cmake: starting with MySQL 5.5.Using cmake for project management, cmake requires version 2.8or above.

Bison: the MySQL syntax parser needs to be compiled using bison.

Ncurses-devel: a development package for terminal operations.

Zlib: MySQL uses zlib for compression

Packages required for featur

Libxml: support for XML input and output.

Openssl: communicate using openssl secure sockets.

Dtrace: used to diagnose MySQL problems.

About MySQL compilation parameters

CMAKE_BUILD_TYPE compiled version types: RelWithDebInfo and Debug, the difference is that RelWithDebInfo is optimized.

CMAKE_INSTALL_PREFIX specifies the destination path for the make install installation.

SYSCONFDIR specifies the default path to the configuration file.

MYSQL_DATADIR specifies the default path to the data directory.

WITH_DEBUG specifies whether there is debugging information. Generally, when debugging source code, WITH_DEBUG is turned on and the production environment is closed.

ENABLED_PROFILING specifies whether show profile can be used to display the details of the operation.

DEFAULT_CHARSET specifies the default character set, which can be specified in the startup configuration file.

DEFAULT_COLLATION specifies the default rules for character comparison and sorting.

WITH_EXTRA_CHARSETS specifies other character sets that may be used.

WITH_SSL specifies the type of SSL, the default bundled type starting at 5.6.6, and you can also specify the path address of the SSL library.

WITH_ZLIB specifies the type of zlib for the compression feature.

ENABLED_LOCAL_INFILE specifies whether the load data infile feature is allowed.

WITH_EMBEDDED_SERVER specifies whether to compile the libmysqld embedded library.

INSTALL_LAYOUT specifies the type of layout to install.

WITH_storage_STORAGE_ENGINE specifies the storage engine supported by compilation, and the MyISAM,MERGE,MEMORY,CSV storage engine is supported by default.

For more detailed parameters, please see http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html.

This installation environment

[root@SZ-RD03 ~] # cat / etc/issue

CentOS release 5.9 (Final)

Kernel\ r on an\ m

[root@SZ-RD03] # uname-a

Linux SZ-RD03 2.6.18-348.el5 # 1 SMP Tue Jan 8 17:53:53 EST 2013 x86 "64 GNU/Linux

MySQL version: 5.6.12-log Source distribution

The installation directory is: / usr/local/mysql

The data directory is: / data/mysqldata

Storage engines include: MEMORY,MyISAM,InnoDB, etc.

Character set: UTF8

2. Install MySQL with source code

Install the libraries you need first:

Yum-y install gcc gcc-c++ ncurses-devel

Download the required software packages:

# put all the downloaded files in the / usr/local/src directory, as follows

# cd / usr/local/src

# wget http://www.cmake.org/files/v2.8/cmake-2.8.11.1.tar.gz

# wget http://ftp.gnu.org/gnu/bison/bison-2.7.tar.gz

# wget http://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.gz

# wget http://www.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.12.tar.gz/from/http://cdn.mysql.com/

Install the cmake compiler

# cd / usr/local/src

# tar-zxvf cmake-2.8.11.1.tar.gz

# cd cmake-2.8.11.1

#. / bootstrap

# make & & make install

Install M4

# cd / usr/local/src

# tar-zxvf M4-1.4.16.tar.gz

# cd M4-1.4.16

#. / configure & & make & & make install

Install bison

# cd / usr/local/src

# tar-zxvf bison-2.7.tar.gz

# cd bison-2.7

#. / configure & & make & & make install

Create mysql users and groups, related directories

# / usr/sbin/groupadd mysql

# / usr/sbin/useradd-g mysql mysql

# mkdir-p / usr/local/mysql

# chown-R mysql:mysql / usr/local/mysql

# mkdir-p / data/mysqldata

# chown-R mysql:mysql / data/mysqldata/

Install mysql

# cd / usr/local/src

# tar-zxvf mysql-5.6.12.tar.gz

# export CFLAGS= "- O3-g-fno-exceptions-static-libgcc-fno-omit-frame-pointer-fno-strict-aliasing"

# export CXXFLAGS= "- O3-g-fno-exceptions-fno-rtti-static-libgcc-fno-omit-frame-pointer-fno-strict-aliasing"

# export CXX=g++

# cd mysql-5.6.12

# cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/-DMYSQL_UNIX_ADDR=/tmp/mysql.sock

-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_EXTRA_CHARSETS=utf8,gbk

-DWITH_PERFSCHEMA_STORAGE_ENGINE=1-DWITH_FEDERATED_STORAGE_ENGINE=1-DWITH_PARTITION_STORAGE_ENGINE=1

-DWITH_ARCHIVE_STORAGE_ENGINE=1-DMYSQL_DATADIR=/data/mysqldata/-DSYSCONFDIR=/usr/local/mysql/

-DWITH_SSL=bundled-DENABLED_LOCAL_INFILE=1-DWITH_INNOBASE_STORAGE_ENGINE=1

-DWITH_BLACKHOLE_STORAGE_ENGINE=1-DENABLE_DOWNLOADS=1

# make & & make install

Initialize the database

# cd / usr/local/mysql/

#. / scripts/mysql_install_db-user=mysql-ldata=/data/mysqldata

3. The final work after installation

Configure the running environment

# vim / etc/profile

# export PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH

# source / etc/profile

Create boot boot

# cp support-files/my-default.cnf / etc/my.cnf # can also copy my.cnf directly to the installation file location

# cp support-files/mysql.server / etc/init.d/mysqld

# chkconfig-- level 35 mysqld on

# service mysqld start

Check to see if the startup is successful

Netstat-ntlp | grep mysql

Set root password

# mysqladmin-u root password 'xxx'

Login account

# mysql-uroot-pxxx

Configuration parameters

Configure my.cnf files according to system and business requirements

At this point, I believe you have a deeper understanding of the "detailed process of installing MySQL5.6.12 source code under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report