CentOS6.7通过cmake编译安装mysql5.5.32

Cmake安装mysql-5.5.32

一、查看系统信息

[[email protected] ~]# cat /etc/redhat-release

CentOS release 6.7 (Final)

[[email protected] ~]# uname -r

2.6.32-573.el6.x86_64

二、安装环境准备

[[email protected] ~]# mkdir /tools

rz上传cmake、mysql源码包

[[email protected] ~]# ls /tools/

cmake-2.8.8.tar.gz  mysql-5.5.32.tar.gz

[[email protected] tools]# tar xf cmake-2.8.8.tar.gz

[[email protected] tools]# cd cmake-2.8.8

[[email protected] cmake-2.8.8]# ./configure

-- Searching 16 bit integer

-- Check size of unsigned short

-- Check size of unsigned short - done

-- Using unsigned short

-- Check if the system is big endian - little endian

-- Looking for wsyncup in /usr/lib64/libcurses.so

-- Looking for wsyncup in /usr/lib64/libcurses.so - found

-- Looking for elf.h

-- Looking for elf.h - found

-- Enable ninja generator.

-- Looking for a Fortran compiler

-- Looking for a Fortran compiler - /usr/bin/f95

-- Could NOT find Qt4 (missing:  QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY)

-- Configuring done

-- Generating done

-- Build files have been written to: /tools/cmake-2.8.8

---------------------------------------------

CMake has bootstrapped.  Now run gmake.

[[email protected] cmake-2.8.8]# gmake

[ 99%] Built target CMakeLibTests

Scanning dependencies of target runcompilecommands

[100%] Building CXX object Tests/CMakeLib/CMakeFiles/runcompilecommands.dir/run_compile_commands.cxx.o

Linking CXX executable runcompilecommands

[100%] Built target runcompilecommands

Scanning dependencies of target foo

[100%] Building CXX object Tests/FindPackageModeMakefileTest/CMakeFiles/foo.dir/foo.cpp.o

Linking CXX static library libfoo.a

[100%] Built target foo

[[email protected] cmake-2.8.8]# gmake install

-- Installing: /usr/local/doc/cmake-2.8/cmake-policies.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-properties.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-variables.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-modules.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-commands.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-compatcommands.txt

-- Installing: /usr/local/doc/cmake-2.8/ctest.txt

-- Installing: /usr/local/doc/cmake-2.8/ctest.docbook

-- Installing: /usr/local/doc/cmake-2.8/cpack.txt

-- Installing: /usr/local/doc/cmake-2.8/cpack.docbook

-- Installing: /usr/local/doc/cmake-2.8/ccmake.txt

-- Installing: /usr/local/doc/cmake-2.8/ccmake.docbook

-- Installing: /usr/local/share/aclocal/cmake.m4

[[email protected] cmake-2.8.8]# echo $?

0    #####验证安装成功

Cmake安装成功,下一步安装mysql,首先安装mysql依赖包

[[email protected] cmake-2.8.8]# yum -y install ncurses-devel libaio-devel

[[email protected] ~]# useradd mysql -s /sbin/nologin -M

[[email protected] tools]# tar xf mysql-5.5.32.tar.gz

[[email protected] tools]# ls

cmake-2.8.8  cmake-2.8.8.tar.gz  mysql-5.5.32  mysql-5.5.32.tar.gz

[[email protected] tools]# cd mysql-5.5.32

[[email protected] mysql-5.5.32]# cmake . -DCMAKE_INSTALL_PREFIX=/app/mysql-5.5.32 \

> -DMYSQL_DATADIR=/app/mysql-5.5.32/data \

> -DMYSQL_UNIX_ADDR=/app/mysql-5.5.32/tmp/mysql.sock \

> -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_ENGINE=1 \

> -DWITH_FAST_MUTEXES=1 \

> -DWITH_ZLIB=bundled \

> -DENABLED_LOCAL_INFILE=1 \

> -DWITH_READLINE=1 \

> -DWITH_EMBEDDED_SERVER=1 \

> -DWITH_DEBUG=0

-- Found Curses: /usr/lib64/libcurses.so

-- Looking for tputs in /usr/lib64/libcurses.so

-- Looking for tputs in /usr/lib64/libcurses.so - found

-- Looking for include file libaio.h

-- Looking for include file libaio.h - found

-- Looking for io_queue_init in aio

-- Looking for io_queue_init in aio - found

-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS

-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS - Success

-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC

-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC - Success

-- Check size of pthread_t

-- Check size of pthread_t - done

-- Performing Test HAVE_PEERCRED

-- Performing Test HAVE_PEERCRED - Success

-- Configuring done

-- Generating done

-- Build files have been written to: /tools/mysql-5.5.32

[[email protected] mysql-5.5.32]#

[[email protected] mysql-5.5.32]# make && make install

-- Installing: /app/mysql-5.5.32/man/man1/mysql_find_rows.1

-- Installing: /app/mysql-5.5.32/man/man1/myisamchk.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql_install_db.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql.server.1

-- Installing: /app/mysql-5.5.32/man/man1/myisam_ftdump.1

-- Installing: /app/mysql-5.5.32/man/man1/mysqlslap.1

-- Installing: /app/mysql-5.5.32/man/man1/comp_err.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql_plugin.1

-- Installing: /app/mysql-5.5.32/man/man1/my_print_defaults.1

-- Installing: /app/mysql-5.5.32/man/man1/mysqladmin.1

-- Installing: /app/mysql-5.5.32/man/man1/mysqlbinlog.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql_fix_extensions.1

-- Installing: /app/mysql-5.5.32/man/man1/resolve_stack_dump.1

-- Installing: /app/mysql-5.5.32/man/man8/mysqld.8

-- Installing: /app/mysql-5.5.32/support-files/solaris/postinstall-solaris

安装成功后,创建软连接

[[email protected] /]# ln -s /app/mysql-5.5.32/ /app/mysql

[[email protected] /]# ll /app

total 4

lrwxrwxrwx  1 root root   18 Sep  8 14:53 mysql -> /app/mysql-5.5.32/

drwxr-xr-x 13 root root 4096 Sep  8 14:51 mysql-5.5.32

备份my.cnf

[[email protected] /]# ls /etc/my.cnf

/etc/my.cnf

[[email protected] /]# mv /etc/my.cnf /etc/my.cnf.bak

[[email protected] mysql-5.5.32]# \cp support-files/my-small.cnf /etc/my.cnf

[[email protected] mysql-5.5.32]# chown -R mysql.mysql /app/mysql/data

###授权mysql管理

[[email protected] mysql-5.5.32]#echo ‘PAHT=/app/mysql/bin:$PATH‘ >> /etc/profile

[[email protected] mysql-5.5.32]#.  /etc/profile

###修改全局路径,并生效

下一步初始化数据库

[[email protected] mysql-5.5.32]# cd /app/mysql/scripts/

[[email protected] scripts]# ./mysql_install_db  --basedir=/app/mysql --datadir=/app/mysql/data/ --user=mysql

#####加./ 是为了避免初始化过程中系统执行默认路径的mysql_install_db

WARNING: The host ‘mysql‘ could not be looked up with resolveip.

This probably means that your libc libraries are not 100 % compatible

with this binary MySQL version. The MySQL daemon, mysqld, should work

normally with the exception that host name resolving will not work.

This means that you should use IP addresses instead of hostnames

when specifying MySQL privileges !

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/app/mysql/bin/mysqladmin -u root password ‘new-password‘

/app/mysql/bin/mysqladmin -u root -h mysql password ‘new-password‘

Alternatively you can run:

/app/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd /app/mysql ; /app/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd /app/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /app/mysql/scripts/mysqlbug script!

出现两个ok代表初始化成功

[[email protected] scripts]# cd /tools/mysql-5.5.32

[[email protected] mysql-5.5.32]# \cp support-files/mysql.server /etc/init.d/mysqld

[[email protected] mysql-5.5.32]# chmod +x /etc/init.d/mysqld

[[email protected] mysql-5.5.32]# /etc/init.d/mysqld start

Starting MySQL...

Mysql安装完毕,并启动成功

Cmake安装mysql-5.5.32

一、查看系统信息

[[email protected] ~]# cat /etc/redhat-release

CentOS release 6.7 (Final)

[[email protected] ~]# uname -r

2.6.32-573.el6.x86_64

二、安装环境准备

[[email protected] ~]# mkdir /tools

rz上传cmake、mysql源码包

[[email protected] ~]# ls /tools/

cmake-2.8.8.tar.gz  mysql-5.5.32.tar.gz

[[email protected] tools]# tar xf cmake-2.8.8.tar.gz

[[email protected] tools]# cd cmake-2.8.8

[[email protected] cmake-2.8.8]# ./configure

-- Searching 16 bit integer

-- Check size of unsigned short

-- Check size of unsigned short - done

-- Using unsigned short

-- Check if the system is big endian - little endian

-- Looking for wsyncup in /usr/lib64/libcurses.so

-- Looking for wsyncup in /usr/lib64/libcurses.so - found

-- Looking for elf.h

-- Looking for elf.h - found

-- Enable ninja generator.

-- Looking for a Fortran compiler

-- Looking for a Fortran compiler - /usr/bin/f95

-- Could NOT find Qt4 (missing:  QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY)

-- Configuring done

-- Generating done

-- Build files have been written to: /tools/cmake-2.8.8

---------------------------------------------

CMake has bootstrapped.  Now run gmake.

[[email protected] cmake-2.8.8]# gmake

[ 99%] Built target CMakeLibTests

Scanning dependencies of target runcompilecommands

[100%] Building CXX object Tests/CMakeLib/CMakeFiles/runcompilecommands.dir/run_compile_commands.cxx.o

Linking CXX executable runcompilecommands

[100%] Built target runcompilecommands

Scanning dependencies of target foo

[100%] Building CXX object Tests/FindPackageModeMakefileTest/CMakeFiles/foo.dir/foo.cpp.o

Linking CXX static library libfoo.a

[100%] Built target foo

[[email protected] cmake-2.8.8]# gmake install

-- Installing: /usr/local/doc/cmake-2.8/cmake-policies.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-properties.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-variables.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-modules.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-commands.txt

-- Installing: /usr/local/doc/cmake-2.8/cmake-compatcommands.txt

-- Installing: /usr/local/doc/cmake-2.8/ctest.txt

-- Installing: /usr/local/doc/cmake-2.8/ctest.docbook

-- Installing: /usr/local/doc/cmake-2.8/cpack.txt

-- Installing: /usr/local/doc/cmake-2.8/cpack.docbook

-- Installing: /usr/local/doc/cmake-2.8/ccmake.txt

-- Installing: /usr/local/doc/cmake-2.8/ccmake.docbook

-- Installing: /usr/local/share/aclocal/cmake.m4

[[email protected] cmake-2.8.8]# echo $?

0    #####验证安装成功

Cmake安装成功,下一步安装mysql,首先安装mysql依赖包

[[email protected] cmake-2.8.8]# yum -y install ncurses-devel libaio-devel

[[email protected] ~]# useradd mysql -s /sbin/nologin -M

[[email protected] tools]# tar xf mysql-5.5.32.tar.gz

[[email protected] tools]# ls

cmake-2.8.8  cmake-2.8.8.tar.gz  mysql-5.5.32  mysql-5.5.32.tar.gz

[[email protected] tools]# cd mysql-5.5.32

[[email protected] mysql-5.5.32]# cmake . -DCMAKE_INSTALL_PREFIX=/app/mysql-5.5.32 \

> -DMYSQL_DATADIR=/app/mysql-5.5.32/data \

> -DMYSQL_UNIX_ADDR=/app/mysql-5.5.32/tmp/mysql.sock \

> -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_ENGINE=1 \

> -DWITH_FAST_MUTEXES=1 \

> -DWITH_ZLIB=bundled \

> -DENABLED_LOCAL_INFILE=1 \

> -DWITH_READLINE=1 \

> -DWITH_EMBEDDED_SERVER=1 \

> -DWITH_DEBUG=0

-- Found Curses: /usr/lib64/libcurses.so

-- Looking for tputs in /usr/lib64/libcurses.so

-- Looking for tputs in /usr/lib64/libcurses.so - found

-- Looking for include file libaio.h

-- Looking for include file libaio.h - found

-- Looking for io_queue_init in aio

-- Looking for io_queue_init in aio - found

-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS

-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS - Success

-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC

-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC - Success

-- Check size of pthread_t

-- Check size of pthread_t - done

-- Performing Test HAVE_PEERCRED

-- Performing Test HAVE_PEERCRED - Success

-- Configuring done

-- Generating done

-- Build files have been written to: /tools/mysql-5.5.32

[[email protected] mysql-5.5.32]#

[[email protected] mysql-5.5.32]# make && make install

-- Installing: /app/mysql-5.5.32/man/man1/mysql_find_rows.1

-- Installing: /app/mysql-5.5.32/man/man1/myisamchk.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql_install_db.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql.server.1

-- Installing: /app/mysql-5.5.32/man/man1/myisam_ftdump.1

-- Installing: /app/mysql-5.5.32/man/man1/mysqlslap.1

-- Installing: /app/mysql-5.5.32/man/man1/comp_err.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql_plugin.1

-- Installing: /app/mysql-5.5.32/man/man1/my_print_defaults.1

-- Installing: /app/mysql-5.5.32/man/man1/mysqladmin.1

-- Installing: /app/mysql-5.5.32/man/man1/mysqlbinlog.1

-- Installing: /app/mysql-5.5.32/man/man1/mysql_fix_extensions.1

-- Installing: /app/mysql-5.5.32/man/man1/resolve_stack_dump.1

-- Installing: /app/mysql-5.5.32/man/man8/mysqld.8

-- Installing: /app/mysql-5.5.32/support-files/solaris/postinstall-solaris

安装成功后,创建软连接

[[email protected] /]# ln -s /app/mysql-5.5.32/ /app/mysql

[[email protected] /]# ll /app

total 4

lrwxrwxrwx  1 root root   18 Sep  8 14:53 mysql -> /app/mysql-5.5.32/

drwxr-xr-x 13 root root 4096 Sep  8 14:51 mysql-5.5.32

备份my.cnf

[[email protected] /]# ls /etc/my.cnf

/etc/my.cnf

[[email protected] /]# mv /etc/my.cnf /etc/my.cnf.bak

[[email protected] mysql-5.5.32]# \cp support-files/my-small.cnf /etc/my.cnf

[[email protected] mysql-5.5.32]# chown -R mysql.mysql /app/mysql/data

###授权mysql管理

[[email protected] mysql-5.5.32]#echo ‘PAHT=/app/mysql/bin:$PATH‘ >> /etc/profile

[[email protected] mysql-5.5.32]#.  /etc/profile

###修改全局路径,并生效

下一步初始化数据库

[[email protected] mysql-5.5.32]# cd /app/mysql/scripts/

[[email protected] scripts]# ./mysql_install_db  --basedir=/app/mysql --datadir=/app/mysql/data/ --user=mysql

#####加./ 是为了避免初始化过程中系统执行默认路径的mysql_install_db

WARNING: The host ‘mysql‘ could not be looked up with resolveip.

This probably means that your libc libraries are not 100 % compatible

with this binary MySQL version. The MySQL daemon, mysqld, should work

normally with the exception that host name resolving will not work.

This means that you should use IP addresses instead of hostnames

when specifying MySQL privileges !

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/app/mysql/bin/mysqladmin -u root password ‘new-password‘

/app/mysql/bin/mysqladmin -u root -h mysql password ‘new-password‘

Alternatively you can run:

/app/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd /app/mysql ; /app/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd /app/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /app/mysql/scripts/mysqlbug script!

出现两个ok代表初始化成功

[[email protected] scripts]# cd /tools/mysql-5.5.32

[[email protected] mysql-5.5.32]# \cp support-files/mysql.server /etc/init.d/mysqld

[[email protected] mysql-5.5.32]# chmod +x /etc/init.d/mysqld

[[email protected] mysql-5.5.32]# /etc/init.d/mysqld start

Starting MySQL...

Mysql安装完毕,并启动成功

原文地址:https://www.cnblogs.com/joolearn/p/9610143.html

时间: 2024-11-08 05:04:37

CentOS6.7通过cmake编译安装mysql5.5.32的相关文章

CentOS6.7下使用cmake编译安装MySQL5.5.32笔记

一.安装cmake编译环境1.1 使用yum方式安装gcc [[email protected] ~]# yum install gcc 1.2 使用yum方式安装gcc-c++ [[email protected] ~]# yum install gcc-c++ 1.3 解压camke源文件 将cmake源文件放入/tmp/文件夹下 1 [[email protected] ~]# cd /tmp 2 [[email protected] ~]# tar -xf cmake-2.8.8.tar

cmake编译安装mysql5.5

CMAKE方式编译安装Mysql5.5 1.源码cmake方式编译安装MySQL5.5.32 安装前先安装: yum install ncurses-devel -y 1.1 下载Mysql和cmake安装包: wget http://wwwNaNake.org/files/v2.8/cmake-2.8.8.tar.gz 1.2 查看系统环境 cat /etc/redhat-release uname -r uname -m 1.3 安装cmake包 tar zxf cmake-2.8.8.ta

编译安装mysql-5.5.32

由于MySQL5.5.xx-5.6.xx产品系列特性,所以编译方式和早期产品安装方式不同 采用cmake方式编译安装MySQL-5.5.32 检查好所需的开发环境,小编在这里用的是centos6.5       执行以下命令即可:yum -y groupinstall "Development tools" "Compatibility libraries" 1.需要准备的安装包 wget /home/oldboy/tools http://mysql.ntu.ed

CentOS 6.8 编译安装MySQL5.5.32 (二 多实例)

MySQL多实例的配置 通过上文 CentOS 6.8 编译安装MySQL5.5.32 ,我们完成了编译安装,接下配置多实例 5,添加多实例目录 [[email protected] application]# mkdir -p /data/{3306,3307}/data [[email protected] application]# tree  /data/ /data/ ├── 3306    │   └── data    └── 3307        └── data, 6,上传多

cmake源码编译安装mysql-5.5.32:多实例遇到的坑

坑1:找不到mysql-5.5.32.tar.gz 源码包费劲了很多力气才找到:mysql 源码包下载地址:https://downloads.mysql.com/archives/community/ 下载路径https://downloads.mysql.com/archives/get/file/mysql-5.5.32.tar.gz授人以鱼,我是怎么找到的? 坑2:cmake配置报错因为\后面有空格导致的,cmake编译参数正确的为如下:cmake . -DCMAKE_INSTALL_P

CentOS 6.8 编译安装MySQL5.5.32(一)

部署之前我们说说,MySQL的几种安装方式: 编译安装:优点是可以定制,按照公司要求个性化设置:缺点:编译复杂,解决依赖问题 二进制安装:优点无需编译,解压即可:缺点 软件包较大 yum安装:结合了上面2个的优点,但需要自己定制rpm包,放到yum仓库中, 然后只需执行一个命令yuminstall mysql-server -y 即可完成. 那我们选择MySQL的安装方式呢? 若是对数据库要求不太高的场景,可以采用yum/rpm方式安装MySQL,例如并发不大,只是在公司内部.企业内部的应用(Z

在CentOS6.7操作系统上编译安装mysql-5.6.31

功能概述: 由于在centos 6.7下通过yum安装的mysql是5.1版本的,不满足需求,因此经常性需要编译安装mysql服务等. 一.安装mysql 1.安装前提 1)安装编译mysql代码所依赖的包 [[email protected] ~]# yum -y install make gcc-c++ cmake bison-devel  ncurses-devel   2)下载mysql-5.5.20源码包 [[email protected] ~]#http://mirrors.soh

用CentOS7.0编译安装Mysql5.5.32

(1)CentOS 版本:安装的时候最小化安装必须有下列包组:yum groupinstall "Compatibility libraries" "Base" "Development tools" yum groupinstall "debugging Tools" "Dial-up Networking Support" 注意:不要使用yum的删除功能删除软件,会删除相关依赖,导致意外问题.(2)1.

centos6.4下编译安装MySQL-5.5.33

若想在6.4版本下的centos编译安装MySQL必须使用新的编译器cmake. 1)安装cmake 直接yum安装 2)编译安装参数 使用cmake编译安装mysql-5.5.33,选项的方式有所改变: ./configure                cmake .            编译   ./configure –help         cmake . -LH or ccmake .   获取帮助 指定安装文件的安装路径时常用的选项:    -DCMAKE_INSTALL_P