linux下编译安装mysql
程序员文章站
2022-06-04 13:35:19
...
准备工作:
1.虚拟机上运行的centos6.6操作系统
2.网络能连接外网
安装步骤:
1.检测系统是否安装mysql
[[email protected] mysql-5.6.12]# rpm -qa|grep mysql
mysql-libs-5.1.73-3.el6_5.x86_64
或
[[email protected] mysql-5.6.12]# rpm -qa | grep -i libs | grep -i mysql
mysql-libs-5.1.73-3.el6_5.x86_64
2.发现系统预安装的mysql-libs包,那么卸载它,扫清障碍
[[email protected] mysql-5.6.12]# rpm -e mysql-libs
error: Failed dependencies:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
mysql-libs is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
发生错误,提示需要postfix,所以有了
[[email protected] mysql-5.6.12]# rpm -e --nodeps mysql-libs-5.1.73-3.el6_5.x86_64
[[email protected] mysql-5.6.12]# rpm -qa | grep -i libs | grep -i mysql
[[email protected] mysql-5.6.12]#
清除干净了。
3.先安装,编译需要的包、工具
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
4.cmake
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
cmake结果:
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://foo.bar.com:80
Warning: Bison executable not found in PATH
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
-- Configuring done
CMake Warning (dev) in sql/CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "mysqld" has an INTERFACE_LINK_LIBRARIES property which differs from
its LINK_INTERFACE_LIBRARIES properties.
INTERFACE_LINK_LIBRARIES:
-lpthread;sql;binlog;rpl;master;slave;sql;mysys;mysys_ssl
LINK_INTERFACE_LIBRARIES:
rt
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
WITH_MEMORY_STORAGE_ENGINE
WITH_READLINE
-- Build files have been written to: /usr/mingSoft/mysql-5.6.12
[[email protected] mysql-5.6.12]#
5.安装
make && make install
编译的参数可以参考http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html
上一篇: 手上暗藏五美容穴位 按摩鱼际穴散淤润肤
下一篇: 女人睡前常揉腹部,好处多到你想不到
推荐阅读
-
linux下mysql5.7.17最新稳定版本安装教程
-
Linux安装MySQL教程(二进制分发版)
-
linux下mysql的安装步骤
-
Windows10下mysql 5.7.17 安装配置方法图文教程
-
Linux下 php7安装redis的方法
-
Linux 安装JDK Tomcat MySQL的教程(使用Mac远程访问)
-
Win7下安装MySQL5.7.16过程记录
-
Windows下mysql5.7.10安装配置方法图文教程
-
Windows server 2008 r2下MySQL5.7.17 winx64安装版配置方法图文教程
-
Ubuntu Server 16.04下mysql8.0安装配置图文教程