数据库学习之--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.serverFor 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.server2、准备源码安装所需要的工具和库文件(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、源码安装,检测编译环境

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

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

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

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

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

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

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

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


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

SublimeText3汉化版
中文版,非常好用

WebStorm Mac版
好用的JavaScript开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

SublimeText3 Linux新版
SublimeText3 Linux最新版