CentOS7下二进制文件安装MySQL5.6
1.查看已装包
[root@host2 ~]# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.x86_64
[root@host2 ~]#
[root@host2 ~]#
卸载
[root@host2 ~]#rpm -e
mysql-libs-5.1.71-1.el6.x86_64
如果失败,可能存在依赖包,需要重新卸载
#强制卸载,因为没有--nodeps
[root@host2 ~]#rpm -e –nodeps
mysql-libs-5.1.71-1.el6.x86_64
2.#列出所有被安装的rpm package
[root@host2 ~]#rpm -qa | grep mariadb
#卸载
[root@host2 ~]#rpm -e
mariadb-libs-5.5.37-1.el7_0.x86_64
如果失败,可能存在依赖包,需要重新卸载
#强制卸载,因为没有--nodeps
[root@host2 ~]#rpm -e --nodeps
mariadb-libs-5.5.37-1.el7_0.x86_64
查验,这样删的彻底
[root@host2 ~]# find / -name mysql
[root@host2 ~]# find / -name *mysql*
[root@host2 ~]#
3.增加mysql用户和组
#useradd -r参数表示mysql用户是系统用户,不可用于登录系统。
[root@host2 backup]# groupadd mysql
[root@host2 backup]# useradd -r -g mysql mysql
[root@host2 backup]# passwd mysql <passward>
[root@host2 backup]# id mysql
4.将二进制的安装包上传到Linux服务器(/usr/local/)
到压缩包指定目录
[root@host2 backup] #cd /usr/local/
解压缩安装包
[root@host2 local]#tar -zxvf
mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz
更名为将解压缩后的文件夹更名
[root@host2 local]#mv
mysql-5.6.29-linux-glibc2.5-x86_64 mysql
进入到mysql文件夹
[root@host2 local]#cd mysql
(根据实际生产需要,将data移动到指定的文件夹)
5.修改数据库文件和日志文件所在目录到属主和属组
[root@host2 mysql]#chown -R mysql:mysql
data
6.创建MySQL Server系统表
添加环境变量MYSQL_HOME,并将mysql_install_db存放到MYSQL_HOME/bin文件夹下面。
[root@host2 mysql]#vi /etc/profile
在最后添加:
MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
保存,并刷新配置信息
[root@host2 mysql]#source /etc/profile
[root@host2 mysql]#scripts/mysql_install_db
–user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data
7.如果报错,则运行下面的命令
[root@bogon mysql]# yum -y install perl perl-devel
[root@bogon mysql]# yum -y install libaio
[root@localhost src]# yum install perl-Data-Dumper -y
8.复制配置文件
在mysql文件夹下的support-files文件夹中,有一个my-default.cnf文件,将他拷贝到/ect/ 并重命名为my.cnf
[root@host2 support-files]#cp
my-default.cnf /etc/my.cnf
9.配置mysqld启动脚本
将scripts/mysql.server服务脚本复制到/etc/init.d/,并重命名为mysqld
[root@host2 support-files]#cp
support-files/mysql.server /etc/init.d/mysqld
10.启动mysql
[root@localhost mysql]# /etc/rc.d/init.d/mysqld status
MySQL is not running, but lock file
(/var/lock/subsys/mysql[FAILED]
[root@localhost mysql]# /etc/rc.d/init.d/mysqld
start
Starting MySQL...The server quit without
updating PID file (/usr/local/mysql/data/localhost.localdomain.pid). [FAILED]
[root@localhost ~]# cd /usr/local/mysql
[root@localhost mysql]# chown -R mysql.mysql .
[root@localhost mysql]# su - mysql
[mysql@localhost ~]$ cd /usr/local/mysql
[mysql@localhost mysql]$
scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql
–datadir=/usr/local/mysql/data
11.验证
运行mysql
[root@host2 support-files]# mysql
Welcome to the MySQL monitor.
Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.22 MySQL Community Server (GPL)
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> \q
Bye
12.
安装后mysql的文件所在的位置
都安装在/usr/local/mysql文件夹中
bin (客户端程序和脚本)
data(日志文件和数据库)
docs(文档和ChangeLog)
include(包含(头)文件)
lib(库文件)
scripts(mysql_install_db
脚本,用来安装系统数据库)
share/mysql(错误信息文件)
sql-bench(基准程序)
13,二进制安装mysql的优缺点
优点:
安装简单
可以安装到任何路径下,灵活性好
一台服务器可以安装多个MySQL
缺点:
已经经过编译,性能不如源码编译得好
不能灵活定制编译参数
CentOS7下二进制文件安装MySQL5.6的更多相关文章
- Linux(CentOS7)下二进制安装MySQL5.7.26
记录一下自己在 CentOS7 下二进制安装 MySQL5.7.26 的过程,之前使用 Linux(CentOS7)下rpm安装MySQL8.0.16 之后发现 rpm 方式安装不利于维护,也不利于单 ...
- centos7 下手动安装MySQL-5.6.32-1.linux_glibc2.5.x86_64.rpm-bundle
由于centos7默认不再是mysql数据库,所以度算手动安装一个. 全程参考http://www.2cto.com/database/201501/371451.html 这里摘抄以下这个链接的内容 ...
- CentOS7 下源代码安装mysql5.6
###### mysql ######### 引言:这里选用mysql5.6版本,5.7版本编译时间需要几个小时. 编译安装环境: yum -y install make gcc-c++ cmake ...
- 阿里云Centos7使用yum安装MySQL5.6的正确姿势
阿里云Centos7使用yum安装MySQL5.6 阿里云Centos7使用yum安装MySQL5.6 前言:由于某些不可抗力,我要在自己的阿里云服务器上搭建hadoop+hive+mysql+tom ...
- CentOS7 通过YUM安装MySQL5.7 linux
CentOS7 通过YUM安装MySQL5.7 1.进入到要存放安装包的位置 cd /home/lnmp 2.查看系统中是否已安装 MySQL 服务,以下提供两种方式: rpm -qa | grep ...
- centos6.7下 编译安装MySQL5.7
centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ...
- EnvironmentError: mysql_config not found问题解决(centos7下python安装mysql-python)
centos7下python安装mysql-python模块,执行命令: pip install mysql-python 出现报错:EnvironmentError: mysql_config no ...
- centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...
- Centos7下快速安装Mongo3.2
Centos7下快速安装Mongo3.2 一般安装Mongo推荐源码安装,有时候为了快部署测试环境,或者仅仅是想装个mongo shell,这时候yum安装是最合适的方式, 下面介绍一下如何在Cent ...
随机推荐
- 内存写越界导致破环堆结构引起的崩溃问题定位经验[如报错malloc(): memory corruption或free(): invalid next size]
前段时间开发的一个后端C模块上线后,线上出core,初始时,因为訪问压力不大,所以崩溃是上线3天左右出现的.当时用gdb跟进调用堆栈并检查源代码,发现出core位置的代码沒有啥问题.因为当时开发任务较 ...
- 升级pip3后出现importerror:cannot import name main
在ubuntu中,升级了pip3,再次使用pip3安装相关的python包的时候就出现以下错误 ImportError: cannot import name main 解决:pip3文件在/usr/ ...
- MyBatis:学习笔记(4)——动态SQL
MyBatis:学习笔记(4)——动态SQL
- Ubuntu安装SSH + Windows上配置Putty
1. Ubuntu安装SSH 命令: # sudo apt-get install openssh-server 2. 启动SSH Server 命令: # sudo /etc/init.d/ssh ...
- Android TableLayout 表格布局
TableLayout继承LinearLayout 有多少个TableRow对象就有多少行, 列数等于最多子控件的TableRow的列数 直接在TableLayout加控件,控件会占据一行 Table ...
- 数据库 简单查询 Sql Server 学生表 课程表 选课表
创建教材中的三张表格,并输入相应的数据 Create table student( Sno char(9), Same char(20), Ssex char(2), Sage smallint, S ...
- img标签中alt属性与title属性
alt属性 1.alt属性是考虑到不支持图像显示或者图像显示被关闭的浏览器的用户,以及视觉障碍的用户和使用屏幕阅读器的用户.当图片不显示的时候,图片的替换文字.2.alt属性值得长度必须少于100个英 ...
- 20145210姚思羽《网络对抗》——shellcode注入& Return-to-libc攻击深入
20145210姚思羽<网络对抗>shellcode注入&Return-to-libc攻击深入 shellcode基础知识 Shellcode是一段代码,作为数据发送给受攻击服务器 ...
- Android系统Recovery模式的工作原理【转】
本文转载自:http://blog.csdn.net/mu0206mu/article/details/7464987 在使用update.zip包升级时怎样从主系统(main system)重启进 ...
- 查询速度优化用not EXISTS 代替 not in
1,not in 速度奇慢,要用 not EXISTS ,速度奇快! 大表效果尤其明显 sql中exists,not exists的用法 exists()后面的子查询被称做相关子查询,他是不返回列表的 ...