search
HomeDatabaseMysql Tutorial 数据库学习之--Linux下Mysql源码包安装

数据库学习之--Linux下Mysql源码包安装系统环境:操作系统:RedHatEL6DBSoft:Mysql5.6.4-m7Mysql在linux下的安装方式有两种版本,一种为Binary(二进制),另外

    Mysql 在linux下的安装方式有两种版本,,一种为Binary(二进制),另外一种为Source(源码包),本文为Source Install方式。

1、安装前的准备

解压安装包


[oracle@ogg ~]$ ls

mysql-5.6.4-m7  mysql-5.6.4-m7.tar.gz  mysql-5.6.4-m7.tar.zip  ogg  oradiag_oracle  Readme--?+?.htm

[oracle@ogg ~]$ cd mysql-5.6.4-m7

[oracle@ogg mysql-5.6.4-m7]$ ls BUILD        CMakeLists.txt   COPYING              extra               libmysql     mysql-test  README   sql-bench   support-files  vio BUILD-CMAKE  cmd-line-utils   dbug                 include             libmysqld    mysys       regex    sql-common  tests          win client       config.h.cmake   Docs                 INSTALL-SOURCE      libservices  packaging   scripts  storage     unittest       zlib cmake        configure.cmake  Doxyfile-perfschema  INSTALL-WIN-SOURCE  man          plugin      sql      strings     VERSION

[oracle@ogg mysql-5.6.4-m7]$ tar zxvf mysql-5.6.4-m7.tar.gz

mysql-5.6.4-m7/mysql-test/lib/My/SafeProcess/ mysql-5.6.4-m7/mysql-test/lib/My/SafeProcess/safe_process.cc mysql-5.6.4-m7/mysql-test/lib/My/SafeProcess/safe_kill_win.cc mysql-5.6.4-m7/mysql-test/lib/My/SafeProcess/safe_process_win.cc mysql-5.6.4-m7/mysql-test/lib/My/SafeProcess/Base.pm mysql-5.6.4-m7/mysql-test/lib/My/SafeProcess/CMakeLists.txt ……

查看官方安装文档:INSTALL-SOURCE

 To install and use a MySQL binary distribution, the basic command

  sequence looks like this:

shell> groupadd mysql shell> useradd -r -g mysql mysql shell> cd /usr/local shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data # Next command is optional shell> cp support-files/my-medium.cnf /etc/my.cnf shell> bin/mysqld_safe --user=mysql & # Next command is optional shell> cp support-files/mysql.server /etc/init.d/mysql.server

 For example, with a compressed tar file source distribution on Unix, the basic installation command

sequence looks like this:

# Preconfiguration setup shell> groupadd mysql shell> useradd -r -g mysql mysql # Beginning of source-build specific instructions shell> tar zxvf mysql-VERSION.tar.gz shell> cd mysql-VERSION shell> cmake . shell> make shell> make install # End of source-build specific instructions # Postinstallation setup shell> cd /usr/local/mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data # Next command is optional shell> cp support-files/my-medium.cnf /etc/my.cnf shell> bin/mysqld_safe --user=mysql & # Next command is optional shell> cp support-files/mysql.server /etc/init.d/mysql.server

2、准备源码安装所需要的工具和库文件(RedHat 安装光盘)

[root@ogg ~]# rpm -qa |grep make automake-1.11.1-1.2.el6.noarch make-3.81-19.el6.i686 [root@ogg ~]# rpm -qa |grep bison bison-2.4.1-5.el6.i686 [root@ogg ~]# rpm -qa |grep gcc gcc-c++-4.4.4-13.el6.i686 libgcc-4.4.4-13.el6.i686 gcc-4.4.4-13.el6.i686 gcc-gfortran-4.4.4-13.el6.i686 compat-libgcc-296-2.96-144.el6.i686 [root@ogg ~]# rpm -qa |grep cmake [root@ogg ~]# rpm -qa |grep ncur ncurses-base-5.7-3.20090208.el6.i686 ncurses-libs-5.7-3.20090208.el6.i686 ncurses-5.7-3.20090208.el6.i686 ncurses-devel-5.7-3.20090208.el6.i686 挂载RedHat安装光盘 [root@ogg ~]# mount /dev/cdrom /media/ mount: block device /dev/sr0 is write-protected, mounting read-only [root@ogg ~]# cd /media/ [root@ogg media]# cd Server/ [root@ogg Server]# ls Packages  repodata  TRANS.TBL [root@ogg Server]# cd Packages/ [root@ogg Packages]# ls |grep make automake-1.11.1-1.2.el6.noarch.rpm cmake-2.6.4-5.el6.i686.rpm imake-1.0.2-11.el6.i686.rpm make-3.81-19.el6.i686.rpm makebootfat-1.4-10.el6.i686.rpm pacemaker-1.1.2-7.el6.i686.rpm pacemaker-libs-1.1.2-7.el6.i686.rpm 安装cmake [root@ogg Packages]# rpm -ivh /media/Server/Packages/cmake-2.6.4-5.el6.i686.rpm warning: /media/Server/Packages/cmake-2.6.4-5.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Preparing...                ########################################### [100%]    1:cmake                  ########################################### [100%] [root@ogg Packages]#

3、源码安装,检测编译环境

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
什么是oracle asm什么是oracle asmApr 18, 2022 pm 04:16 PM

oracle asm指的是“自动存储管理”,是一种卷管理器,可自动管理磁盘组并提供有效的数据冗余功能;它是做为单独的Oracle实例实施和部署。asm的优势:1、配置简单、可最大化推动数据库合并的存储资源利用;2、支持BIGFILE文件等。

oracle怎么查询所有索引oracle怎么查询所有索引May 13, 2022 pm 05:23 PM

方法:1、利用“select*from user_indexes where table_name=表名”语句查询表中索引;2、利用“select*from all_indexes where table_name=表名”语句查询所有索引。

Oracle怎么查询端口号Oracle怎么查询端口号May 13, 2022 am 10:10 AM

在Oracle中,可利用lsnrctl命令查询端口号,该命令是Oracle的监听命令;在启动、关闭或重启oracle监听器之前可使用该命令检查oracle监听器的状态,语法为“lsnrctl status”,结果PORT后的内容就是端口号。

oracle全角怎么转半角oracle全角怎么转半角May 13, 2022 pm 03:21 PM

在oracle中,可以利用“TO_SINGLE_BYTE(String)”将全角转换为半角;“TO_SINGLE_BYTE”函数可以将参数中所有多字节字符都替换为等价的单字节字符,只有当数据库字符集同时包含多字节和单字节字符的时候有效。

oracle怎么删除sequenceoracle怎么删除sequenceMay 13, 2022 pm 03:35 PM

在oracle中,可以利用“drop sequence sequence名”来删除sequence;sequence是自动增加数字序列的意思,也就是序列号,序列号自动增加不能重置,因此需要利用drop sequence语句来删除序列。

oracle怎么查询数据类型oracle怎么查询数据类型May 13, 2022 pm 04:19 PM

在oracle中,可以利用“select ... From all_tab_columns where table_name=upper('表名') AND owner=upper('数据库登录用户名');”语句查询数据库表的数据类型。

oracle查询怎么不区分大小写oracle查询怎么不区分大小写May 10, 2022 pm 05:45 PM

方法:1、利用“LOWER(字段值)”将字段转为小写,或者利用“UPPER(字段值)”将字段转为大写;2、利用“REGEXP_LIKE(字符串,正则表达式,'i')”,当参数设置为“i”时,说明进行匹配不区分大小写。

Oracle怎么修改sessionOracle怎么修改sessionMay 13, 2022 pm 05:06 PM

方法:1、利用“alter system set sessions=修改后的数值 scope=spfile”语句修改session参数;2、修改参数之后利用“shutdown immediate – startup”语句重启服务器即可生效。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft