Linux下基于源码方式安装MySQL5.6_MySQL
1、安装环境及介质
#安装介质,可以到以下网址下载安装介质,注意下载时选择source code,当前版本为5.6.17
#源码安装方式官方网站链接: http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html
2、系统需求
Installation of MySQL from source requires several development tools. Some of these tools are needed no matter whether you use a standard source distribution or a development source tree. Other tool requirements depend on which installation method you use.
To install MySQL from source, your system must have the following tools, regardless of installation method:
CMake, which is used as the build framework on all platforms. CMake can be downloaded from http://www.cmake.org.A good make program. Although some platforms come with their own make implementations, it is highly recommended that you use GNU make 3.75 or newer. It may already be available on your system as gmake. GNU make is available from http://www.gnu.org/software/make/.A working ANSI C++ compiler. GCC 4.2.1 or later, Sun Studio 12 or later, Visual Studio 2010 or later, and many current vendor-supplied compilers are known to work.Perl is needed if you intend to run test scripts. Most Unix-like systems include Perl. On Windows, you can use a version such as ActiveState Perl.#使用源码安装上面的一些开发工具是需要的,比较重要的一个是Cmake工具,通常情况下os并没有安装,需要手动安装。
3、安装cmake
4、安装MySQL
..........
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev,
#如果cmake期间碰到上述错误,应该安装ncurses-devel rpm包,然后移除CMakeCache.txt
#如有没有对应的os安装光盘,可以从下面的链接下载这个rpm包,注意对应的版本号应一致
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # rm -rf CMakeCache.txt
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # make
Linking CXX executable mysqltest_embedded
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # make install
..........
SZDB:/usr/local/mysql # chown -R root .
#配置环境变量,通过软链或者修改环境变量实现(PATH=$PATH:/usr/local/mysql/bin/;export PATH)
#登陆到mysql
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
mysql> show databases;
推荐阅读