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

Red Hat mysql5.6 source code compilation and installation process

2025-04-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Operating system

More / etc/centos-release

CentOS release 6.8 (Final)

Mysql5.6.44 version acquisition

Https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.44.tar.gz

1: dependent package installation

Yum list cmake

Yum install cmake-y

Yum install gcc-c++-y

Yum install readline-devel pcre-devel ncurses-devel bison-devel-y

2: create directory installation, user, and get installation package

Mkdir / home/setup

Cd / home/setup

Wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.44.tar.gz

Useradd mysql-s / sbin/nologin-M

Tar-zxvf mysql-5.6.44.tar.gz

3: compile and install

Cd / home/setup/mysql-5.6.44

Cmake. -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6\

-DMYSQL_DATADIR=/data/3306/data\

-DMYSQL_UNIX_ADDR=/data/3306/tmp/mysql.sock\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii\

-DENABLED_LOCAL_INFILE=ON\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_FEDERATED_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\

-DWITHOUT_PARTITION_STORAGE_EGINE=1\

-DWITH_FAST_MUTEXES=1\

-DWITH_ZLIB=bundled\

-DENABLED_LOCAL_INFILE=1\

-DWITH_READLINE=1\

-DWITH_EMBEDDED_SERVER=1\

-DWITH_DEBUG=0

# Root directory of DCMAKE_INSTALL_PREFIX MySQL installation

# Directory where DMYSQL_DATADIR data is stored

# sock file directory of DMYSQL_UNIX_ADDR MySQL socket used by mysql server to listen, must be an absolute path

Make & make install & & cd.

4: install the database

Cd / application/mysql/scripts/

. / mysql_install_db-- basedir=/application/mysql/-- datadir=/data/3306/data-- user=mysql

There are 2 ok indicating that the installation is successful

Mkdir / data/3306/tmp/

Chown-R mysql.mysql / data/3306/tmp/

Cp / application/mysql/bin/* / usr/local/sbin/

Cp / application/mysql/support-files/my-default.cnf / etc/my.cnf

Vim / etc/my.cnf

[mysqld] add:

Datadir=/data/3306/data

Default-storage-engine=InnoDB

Lower_case_table_names=1

Port=3306

5: start the database

Cd / application/mysql/bin

. / mysqld_safe-defaults-file=/data/3306/data/my.cnf-user=mysql &

Log into the database

Mysql-uroot-S / data/3306/tmp/mysql.sock

6: set boot self-startup

Cp support-files/mysql.server / etc/init.d/mysql

Related commands:

Service mysql start

Stop the mysql service

Service mysql stop

Restart the mysql service

Service mysql restart

Add to boot startup item

Chkconfig-add mysql

Occasionally encounter the following error report

FATAL ERROR: please install the following Perl modules before executing. / scripts/mysql_install_db:

Solution method

Yum-y install autoconf

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

Wechat

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

12
Report