创建用户和组

# groupadd mysql
# useradd -r -g mysql mysql

  

解压压缩包

# tar -xvf mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz
# mv mysql-5.6.37-linux-glibc2.12-x86_64 /usr/local
# cd /usr/local/
# ln -s mysql-5.6.37-linux-glibc2.12-x86_64/ mysql
# cd mysql
# ll
total 48
drwxr-xr-x 2 root root 4096 Aug 1 13:13 bin
-rw-r--r-- 1 7161 31415 17987 Jun 3 01:42 COPYING
drwxr-xr-x 3 root root 17 Aug 1 13:13 data
drwxr-xr-x 2 root root 52 Aug 1 13:13 docs
drwxr-xr-x 3 root root 4096 Aug 1 13:13 include
drwxr-xr-x 3 root root 4096 Aug 1 13:13 lib
drwxr-xr-x 4 root root 28 Aug 1 13:13 man
drwxr-xr-x 10 root root 4096 Aug 1 13:13 mysql-test
-rw-r--r-- 1 7161 31415 2496 Jun 3 01:42 README
drwxr-xr-x 2 root root 29 Aug 1 13:13 scripts
drwxr-xr-x 28 root root 4096 Aug 1 13:13 share
drwxr-xr-x 4 root root 4096 Aug 1 13:13 sql-bench
drwxr-xr-x 2 root root 130 Aug 1 13:13 support-files
# chown -R mysql .
# chgrp -R mysql .
# ll
total 48
drwxr-xr-x 2 mysql mysql 4096 Aug 1 13:13 bin
-rw-r--r-- 1 mysql mysql 17987 Jun 3 01:42 COPYING
drwxr-xr-x 3 mysql mysql 17 Aug 1 13:13 data
drwxr-xr-x 2 mysql mysql 52 Aug 1 13:13 docs
drwxr-xr-x 3 mysql mysql 4096 Aug 1 13:13 include
drwxr-xr-x 3 mysql mysql 4096 Aug 1 13:13 lib
drwxr-xr-x 4 mysql mysql 28 Aug 1 13:13 man
drwxr-xr-x 10 mysql mysql 4096 Aug 1 13:13 mysql-test
-rw-r--r-- 1 mysql mysql 2496 Jun 3 01:42 README
drwxr-xr-x 2 mysql mysql 29 Aug 1 13:13 scripts
drwxr-xr-x 28 mysql mysql 4096 Aug 1 13:13 share
drwxr-xr-x 4 mysql mysql 4096 Aug 1 13:13 sql-bench
drwxr-xr-x 2 mysql mysql 130 Aug 1 13:13 support-files

 

初始化数据库

# scripts/mysql_install_db  --user=mysql
Installing MySQL system tables...2017-08-01 13:20:26 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-01 13:20:26 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-08-01 13:20:26 0 [Note] ./bin/mysqld (mysqld 5.6.37) starting as process 3887 ...
2017-08-01 13:20:26 3887 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-08-01 13:20:26 3887 [Note] InnoDB: The InnoDB memory heap is disabled
2017-08-01 13:20:26 3887 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-08-01 13:20:26 3887 [Note] InnoDB: Memory barrier is not used
2017-08-01 13:20:26 3887 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-08-01 13:20:26 3887 [Note] InnoDB: Using Linux native AIO
2017-08-01 13:20:26 3887 [Note] InnoDB: Using CPU crc32 instructions
2017-08-01 13:20:26 3887 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-08-01 13:20:26 3887 [Note] InnoDB: Completed initialization of buffer pool
2017-08-01 13:20:26 3887 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2017-08-01 13:20:26 3887 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2017-08-01 13:20:26 3887 [Note] InnoDB: Database physically writes the file full: wait...
2017-08-01 13:20:26 3887 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2017-08-01 13:20:26 3887 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2017-08-01 13:20:27 3887 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2017-08-01 13:20:27 3887 [Warning] InnoDB: New log files created, LSN=45781
2017-08-01 13:20:27 3887 [Note] InnoDB: Doublewrite buffer not found: creating new
2017-08-01 13:20:27 3887 [Note] InnoDB: Doublewrite buffer created
2017-08-01 13:20:27 3887 [Note] InnoDB: 128 rollback segment(s) are active.
2017-08-01 13:20:27 3887 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-08-01 13:20:27 3887 [Note] InnoDB: Foreign key constraint system tables created
2017-08-01 13:20:27 3887 [Note] InnoDB: Creating tablespace and datafile system tables.
2017-08-01 13:20:27 3887 [Note] InnoDB: Tablespace and datafile system tables created.
2017-08-01 13:20:27 3887 [Note] InnoDB: Waiting for purge to start
2017-08-01 13:20:27 3887 [Note] InnoDB: 5.6.37 started; log sequence number 0
2017-08-01 13:20:27 3887 [Note] Binlog end
2017-08-01 13:20:27 3887 [Note] InnoDB: FTS optimize thread exiting.
2017-08-01 13:20:27 3887 [Note] InnoDB: Starting shutdown...
2017-08-01 13:20:29 3887 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK Filling help tables...2017-08-01 13:20:29 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-01 13:20:29 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-08-01 13:20:29 0 [Note] ./bin/mysqld (mysqld 5.6.37) starting as process 3909 ...
2017-08-01 13:20:29 3909 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-08-01 13:20:29 3909 [Note] InnoDB: The InnoDB memory heap is disabled
2017-08-01 13:20:29 3909 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-08-01 13:20:29 3909 [Note] InnoDB: Memory barrier is not used
2017-08-01 13:20:29 3909 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-08-01 13:20:29 3909 [Note] InnoDB: Using Linux native AIO
2017-08-01 13:20:29 3909 [Note] InnoDB: Using CPU crc32 instructions
2017-08-01 13:20:29 3909 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-08-01 13:20:29 3909 [Note] InnoDB: Completed initialization of buffer pool
2017-08-01 13:20:29 3909 [Note] InnoDB: Highest supported file format is Barracuda.
2017-08-01 13:20:29 3909 [Note] InnoDB: 128 rollback segment(s) are active.
2017-08-01 13:20:29 3909 [Note] InnoDB: Waiting for purge to start
2017-08-01 13:20:29 3909 [Note] InnoDB: 5.6.37 started; log sequence number 1625977
2017-08-01 13:20:29 3909 [Note] Binlog end
2017-08-01 13:20:29 3909 [Note] InnoDB: FTS optimize thread exiting.
2017-08-01 13:20:29 3909 [Note] InnoDB: Starting shutdown...
2017-08-01 13:20:30 3909 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK 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 mysql7 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 Please report any problems at http://bugs.mysql.com/ The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com 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 WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

  

# chown -R root .
# chown -R mysql data
# ll
total 52
drwxr-xr-x 2 root mysql 4096 Aug 1 13:13 bin
-rw-r--r-- 1 root mysql 17987 Jun 3 01:42 COPYING
drwxr-xr-x 3 mysql mysql 17 Aug 1 13:13 data
drwxr-xr-x 2 root mysql 52 Aug 1 13:13 docs
drwxr-xr-x 3 root mysql 4096 Aug 1 13:13 include
drwxr-xr-x 3 root mysql 4096 Aug 1 13:13 lib
drwxr-xr-x 4 root mysql 28 Aug 1 13:13 man
-rw-r--r-- 1 root root 943 Aug 1 13:20 my.cnf
drwxr-xr-x 10 root mysql 4096 Aug 1 13:13 mysql-test
-rw-r--r-- 1 root mysql 2496 Jun 3 01:42 README
drwxr-xr-x 2 root mysql 29 Aug 1 13:13 scripts
drwxr-xr-x 28 root mysql 4096 Aug 1 13:13 share
drwxr-xr-x 4 root mysql 4096 Aug 1 13:13 sql-bench
drwxr-xr-x 2 root mysql 130 Aug 1 13:13 support-files

  

启动数据库

# bin/mysqld_safe  --user=mysql &

  

配置为服务

# cp support-files/mysql.server /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on

 

5.7参考以下步骤:

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> mkdir mysql-files
shell> chmod 770 mysql-files
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql # Before MySQL 5.7.6
shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and up
shell> bin/mysql_ssl_rsa_setup # MySQL 5.7.6 and up
shell> chown -R root .
shell> chown -R mysql data mysql-files
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server

  

二进制安装mysql 5.6的更多相关文章

  1. 二进制安装MySQL数据库

    今天安装的是二进制的mysql包5.7.21的包,在配置文件的时候采了好多坑,左后还是搞定了,来和大家分享一下 二进制msyql5.7.21版本的主从复制安装 新建/picclife目录 mkdir  ...

  2. CentOS 6.5下二进制安装 MySQL 5.6

    CentOS 6.5 二进制安装MySQL 5.6 1:查看系统版本 [root@10-4-5-9 mysql]# cat /etc/redhat-release CentOS release 6.5 ...

  3. 二进制安装MySQL及破解密码

    二进制安装MySQL及破解密码 1.确保系统中有依赖的libaio 软件,如果没有: yum -y install libaio 2.解压二进制MySQL软件包 tar xf mysql-5.7.24 ...

  4. ubuntu14.04下简易二进制安装mysql

    下载mysql-commnunity的5.6.24通用二进制版 tar解压 我安装到/opt目录,所以mv到/opt/ 可选,建了个软链 ln -s *** mysql 添加运行mysql服务的用户和 ...

  5. 编译安装和二进制安装mysql

    二进制安装mysql-5.6.46 mysql二进制安装,已经编译成二进制了,只需要做一些配置即可 [root@localhost ~]$ yum install autoconf libaio -y ...

  6. shell 脚本二进制安装mysql

    以下脚本的手动安装连接:https://www.cnblogs.com/leihongnu/p/12581793.html [ #/bin/bash#脚本安装 mysql,上传安装包至 /rootcd ...

  7. 二进制安装mysql

    1.1 MySQL安装介绍 mysql软件下载地址信息: www.mysql.com   mirrors.sohu.com mysql软件下载完毕后,查看mysql解压后目录文件大小 1.下载解压my ...

  8. 二进制安装Mysql 5.6(免编译)

    安装系统基础软包 yum install -y make bc perl gcc openssl openssl-devel ncurses ncurses-devel 安装方式:二进制免编译安装 查 ...

  9. centos7 使用二进制安装mysql 5.7.23

    1.下载二进制安装包 mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz cd /usr/local/src wget https://cdn.mysql.com// ...

  10. CentOS 6.2下二进制安装 MySQL 5.6

    在CentOS 6.2上 二进制方式安装 MySQL5.6二进制包 可以参考这篇文章: http://www.cnblogs.com/xiaoit/p/3988640.html 一路配置下来很顺利.. ...

随机推荐

  1. iredmail安装问题

    =================================== 已解决::::(据铭哥说 只有最新版0.9.2才会出现这个问题) 解决办法::(都是IPv6惹的祸) vi /etc/dovec ...

  2. javax.validation.UnexpectedTypeException: No validator could be found for constraint 'org.hibernate.validator.constraints.Length' validating type

    使用hibernate validator出现上面的错误, 需要注意: @NotNull 和 @NotEmpty  和@NotBlank 区别 @NotEmpty 用在集合类上面@NotBlank 用 ...

  3. Camtasia Studio CamStudio如何导出为手机视频

    把视频拖放到左侧窗口,再按住拖放到下方的时间轴   点击生成并共享,然后设置为自定义生成设置   这里选择MP4,然后下一步   到这一步的时候,选择视频大小为自定义   会弹出窗口,手动输入宽360 ...

  4. Android中创建PopupMenu弹出式菜单

    之前写过一篇创建option menu的文章:Android中创建option menu 本文主要是讲如何创建PopupMenu弹出式菜单 1.首先创建menu文件menu2.xml: <?xm ...

  5. 使用Phantomjs和ChromeDriver添加Cookies的方法

    一.查看代码 : namespace ToutiaoSpider { class Program { static void Main(string[] args) { var db = Db.Get ...

  6. shell date 命令整理

    最近发现date命令特别好用(在mac里面不行) 1.获取今天的日期 [root@nd02 ~]# date +%Y%m%d 2.获取某一天的日期 [root@nd02 ~]# date -d &qu ...

  7. SSM实战——秒杀系统前言

    项目来源:慕课网http://www.imooc.com/u/2145618/courses?sort=publish 项目开发流程:整合SSM框架——项目需求分析与实现——解决高并发优化 所用技术: ...

  8. 仿饿了么增加购物车旋转控件 - 自带闪转腾挪动画 的button

    本篇文章已授权微信公众号 guolin_blog (郭霖)独家公布 转载请标明出处: http://blog.csdn.net/zxt0601/article/details/54235736 本文出 ...

  9. Netstat命令详解(windows下)

      Netstat 用于显示与IP .TCP .UDP 和ICMP 协议相关的统计数据,一般用于检验本机各端口的网络连接情况. 如果你的计算机有时候接收到的数据报导致出错数据或故障,你不必感到奇怪,T ...

  10. loadrunner 脚本开发-参数化之将内容保存为参数、参数数组及参数值获取

    转自:http://blog.sina.com.cn/s/blog_13cc013b50102v49c.html(查看原文) 在VuGen中默认使用{}的字符串称为参数 注意:参数必须在双引号中才能用 ...