这篇文章主要介绍了SUSE Linux下源代码编译方式安装MySQL 5.6过程分享,本文使用SUSE Linux Enterprise Server 10 SP3 (x86_64)系统,须要的朋友能够參考下.MySQL为开源数据库,因此能够基于源代码实现安装。

基于源代码安装有很多其它的灵活性。

也就是说我们能够针对自己的硬件平台选用合适的编译器来优化编译后的二进制代码,依据不同的软件平台环境调整相关的编译參数,选择自身须要选择不同的安装组件。设定须要的字符集等等一些能够依据特定应用场景所作的各种调整。本文描写叙述了怎样在源代码方式下安装MySQL。

1、安装环境及介质

SZDB:~ # cat /etc/issue
Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64) - Kernel \r (\l).
SZDB:~ # uname -a
Linux SZDB 2.6.16.60-0.54.5-smp #1 SMP Fri Sep 4 01:28:03 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux
#安装介质,能够到下面网址下载安装介质。注意下载时选择source code,当前版本号为5.6.17
#依据你自身的环境下载对应的安装介质,本文演示的安装介质为Generic Linux (Architecture Independent), mysql-5.6.17.tar.gz
http://dev.mysql.com/downloads/mysql
#源代码安装方式官方站点链接: http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html

2、系统需求

Source Installation System Requirements

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并没有安装,须要手动安装。
#假设没有cmake会收到这个错误提示:(-bash: cmake: command not found)

3、安装cmake

#能够到这里下载cmake。我这里下载的是2.6.4版本号

http://www.cmake.org/cmake/resources/software.html
SZDB:~ # cd /usr/local/src/mysql_src
SZDB:/usr/local/src/mysql_src # tar -xvf cmake-2.6.4.tar.gz
SZDB:/usr/local/src/mysql_src # cd cmake-2.6.4
SZDB:/usr/local/src/mysql_src/cmake-2.6.4 # ./bootstrap
SZDB:/usr/local/src/mysql_src/cmake-2.6.4 # ./make
SZDB:/usr/local/src/mysql_src/cmake-2.6.4 # ./make install

4、安装MySQL

SZDB:~ # groupadd mysql
SZDB:~ # useradd -r -g mysql mysql
SZDB:~ # cd /usr/local/src/mysql_src
SZDB:/usr/local/src/mysql_src # tar -xvf mysql-5.6.17.tar.gz
SZDB:/usr/local/src/mysql_src # ls
mysql-5.6.17 mysql-5.6.17.tar.gz
SZDB:/usr/local/src/mysql_src # cd mysql-5.6.17/
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # cmake .
..........
-- Check size of wint_t - done
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:85 (MESSAGE): Author : Leshami
Curses library not found. Please install appropriate package, Blog :http://blog.csdn.net/leshami
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev,
on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:128 (FIND_CURSES)
cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:411 (MYSQL_CHECK_EDITLINE)
#假设cmake期间碰到上述错误,应该安装ncurses-devel rpm包。然后移除CMakeCache.txt
-- Configuring incomplete, errors occurred!
#如有没有相应的os安装光盘,能够从以下的链接下载这个rpm包,注意相应的版本应一致
http://www.filewatcher.com/m/ncurses-devel-5.5-18.11.x86_64.rpm.735840-0.html
SZDB:/usr/local/src/mysql_src # rpm -Uvh ncurses-devel-5.5-18.11.x86_64.rpm
Preparing... ########################################### [100%]
1:ncurses-devel ########################################### [100%]
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # rm -rf CMakeCache.txt
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # cmake . #再次运行cmake
........
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl;aio
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/mysql_src/mysql-5.6.17
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # make
Linking CXX executable mysqltest_embedded
[100%] Built target mysqltest_embedded
Scanning dependencies of target my_safe_process
[100%] Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
Linking CXX executable my_safe_process
[100%] Built target my_safe_process
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # make install
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # cd /usr/local/mysql
SZDB:/usr/local/mysql # chown -R mysql .
SZDB:/usr/local/mysql # chgrp -R mysql .
SZDB:/usr/local/mysql # scripts/mysql_install_db --user=mysql
..........
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:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h SZDB password 'new-password'
Alternatively you can run:
./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 . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
..........
SZDB:/usr/local/mysql # chown -R root .
SZDB:/usr/local/mysql # chown -R mysql data
SZDB:/usr/local/mysql # cp support-files/mysql.server /etc/init.d/mysql.server #配置自启动
SZDB:/usr/local/mysql # cp support-files/my-default.cnf /etc/my.cnf #加入缺省的my.cnf配置文件
SZDB:/usr/local/mysql # bin/mysqld_safe --user=mysql & #启动mysql
[1] 21004
SZDB:/usr/local/mysql # 140521 02:54:54 mysqld_safe Logging to '/usr/local/mysql/data/SZDB.err'.
140521 02:54:54 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
#配置环境变量,通过软链或者改动环境变量实现(PATH=$PATH:/usr/local/mysql/bin/;export PATH)
SZDB:~ # ln -fs /usr/local/mysql/bin/mysql /usr/local/bin
SZDB:~ # ln -fs /usr/local/mysql/bin/mysqladmin /usr/local/bin
SZDB:~ # ln -fs /usr/local/mysql/bin/mysqld_safe /usr/local/bin
#登陆到mysql
SZDB:/usr/local/bin # mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.17 Source distribution
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)

SUSE Linux源代码编译安装MySQL 5.6的更多相关文章

  1. Linux 环境编译安装mysql (源码安装包)

    标注: Linux需要先配置网络yum源,确定yum能在线安装软件包,方便测试过程中安装部分依赖包.配置163网易提示的网络yum源参考博客  http://www.cnblogs.com/zoulo ...

  2. linux源代码编译安装OpenCV

    为了尽可能保证OpenCV的特性,使用OpenCV源代码编译安装在linux上.先从安装其依赖项開始,以ubuntu 14.04.X为例解说在Linux上源代码编译安装OpenCV,其它linux版本 ...

  3. Linux下编译安装MySQL

    一.环境准备yum install -y ncurses-devel libaio-develyum install -y cmake makeuseradd -s /sbin/nologin -M ...

  4. CentOS Linux下编译安装MySQL

    本文参考张宴的Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)[原创]完成.所有操作命令都在CentOS 6.4 64位操作系统下实践 ...

  5. Linux 下编译安装MySQL

    最近在研究Mysql,当然先要把它安装在机器上才行呀.记录下操作,加深记忆,也供以后参考. 准备工作: Linux版本:Redhat Linux 6.4 Mysql版本(安装包):mysql-5.6. ...

  6. linux下 编译安装Mysql

    正文: 一:卸载旧版本 使用下面的命令检查是否安装有MySQL Server rpm -qa | grep mysql 有的话通过下面的命令来卸载掉 rpm -e mysql //普通删除模式 rpm ...

  7. linux(mac) 编译安装MySQL

    Reference: https://blog.csdn.net/Tzhennan/article/details/80565235 官方下载地址:  https://dev.mysql.com/do ...

  8. Linux下编译安装mysql数据库服务

    以下是用putty工具远程登录到服务器,在命令行下面操作: Cmake工具下载地址:http://ftp.lfs-matrix.net/pub/blfs/conglomeration/cmake/ M ...

  9. Linux源代码编译安装tree命令

    wget ftp://mama.indstate.edu/linux/tree/tree-1.6.0.tgz .tgz cd tree- make && make install

随机推荐

  1. 使用Caliburn.Micro系列1:新建项目并引入CM

    一.WPF的几个MVVM模式实现 MVVMLight:小众的平民框架,实现简单粗暴.  pass:最近更新在15年 官网: http://www.mvvmlight.net/ 最近一篇内容全面的好文: ...

  2. java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException

    在进行Spring和Hibernate整合的时候遇到了这个问题, 问题描述如下 问题原因?  Spring的Bean的XML配置文件存在错误 解决方法: 正确的配置XML文件,例如下面的代码 < ...

  3. element--ui使用tab切换时如何获取当前对象的id或者其他属性

    1. 问题 当使用tab切换时,部分特殊场景需要获取当前元素的类名或者id. 2.解决思路,tab切换是绑定函数,函数会传递过去当前对象,通过当前对象获取对象属性 vue部分代码:本项目是在vue-c ...

  4. vue全选与反选以及通过使用如何filter删除数据

    在vue学习经常遇到的一些基本问题,下面是购物车里面的部分功能,分享给初学者,直接上源码: <!DOCTYPE html><html> <head> <met ...

  5. 2018湖南省第14届大学生计算机程序设计竞赛 A字符画

    Description 读入 w,请输出 2018 的字符画,两个数字之间有 w 个空格.具体格式请参考样例输出. 1 ≤ w ≤ 2018 Input 输入文件只包含 1 个整数 w. Output ...

  6. LNMP中PHP服务的配置

    PHP(Hypertxt Preprocessor,超文本预处理器)是一种通用的开源脚本语言,发明于1995年,它吸取了C语言.Java语言及Perl语言的很多优点,具有开源.免费.快捷.跨平台性强. ...

  7. 初学微信小程序 TodoList

    微信小程序的学习 微信小程序的开始尝试 TodoList 微信开发者工具生成 目录如下: . |-- app.js |-- app.json |-- app.wxss |-- pages | |-- ...

  8. 常用的四种设计模式 PHP代码

    // 工厂模式 interface Iuser { public function getUserName(); } class UserFactory { static public functio ...

  9. Django之CBV和FBV

    Django之CBV和FBV CBV和FBV是C和F的区别: C是Class,F是Function 在请求中,有GET请求和POST请求. 在写CBV时,url是可以对应一个类的,在类中,分别写出GE ...

  10. 读书笔记:《人有人的用处》------N.维纳. (2016.12.28)

    读书笔记:<人有人的用处>------N.维纳 ·某些系统可以依其总能量而和其他系统区别开来. ·在某些情况下,一个系统如果保持足够长时间的运转,那它就会遍历一切与其能量相容的位置和动量的 ...