二进制安装mysql 5.6

创建用户和组

# 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

  

时间: 2024-10-17 07:28:39

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

CentOS 6.5下二进制安装 MySQL 5.6

转摘 CentOS 6.5 二进制安装MySQL 5.6 1:查看系统版本 1 2 [[email protected] mysql]# cat /etc/redhat-release CentOS release 6.5 (Final) 2:下载MySQL5.6二进制包 1 #wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.20-linux-glibc2.5-i686.tar.gz 3:添加用户和组 1 2 #groupadd m

编译安装和二进制安装mysql

useradd -r -s /sbin/nologin -M  mysql mkdir -p /opt/data/var yum -y install make gcc-c++ cmake bison-devel  ncurses-devel /etc/init.d/iptables stop chkconfig iptables off sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config yum -y inst

二进制安装mysql方法及其配置

一.实验环境 CentOs 6.6 [[email protected] ~]# uname -rs Linux 2.6.32-504.el6.i686[[email protected] ~]# 二.实验步骤 1.从网上下载适合的版本,本文采用mysql-5.5.48-linux2.6-i686,下载地址如下: wget   /home/chen/tools http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.48-linux2.6-i686.t

二进制安装MySQL数据库

今天安装的是二进制的mysql包5.7.21的包,在配置文件的时候采了好多坑,左后还是搞定了,来和大家分享一下 二进制msyql5.7.21版本的主从复制安装 新建/picclife目录 mkdir  /picclife 新建/picclife/data 目录 mkdir  /picclife/data 创建用户和组 为mysql groupadd  mysql useradd   -g   mysql  mysql 将二进制mysql的包传到/picclife的目录下 解压软件包 tar  -

通用二进制安装MySQL(MariaDB)

一.前言 MySQL是一个关系型数据库管理系统,是最流行的关系型数据库管理系统,由于其体积小.速度快.总体拥有成本低,并且之前是完全开源,所以大受欢迎.但由于后面MySQL卖给了SUN,随后SUN被Oracle收购,虽然也有开源免费版本,但是很多功能都需要另外购买商业版本,导致现在MySQL使用份额逐渐减少.所以MariaDB就是因为这种原因诞生出来,成为数据库管理系统是MySQL的一个分支. 二.MariaDB介绍 MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用

centos 6.5 通用二进制安装mysql 5.6

mysql下载,去mysql 官网现在5.6 二进制版本,如下图: 使用winscp 上传到系统 /usr/local 目录下,如下图 创建mysql 用户和组,如下图 进入/usr/local目录下,解压mysql 将解压包改名或做符号链接,这里直接改名 进入mysql 目录更改目录的所有者和组 7.开启service 启动 8.mysql初始化 9.根据mysql 配置文件的查找顺序,将mysql里的my.cnf 复制到/etc/my.cnf 覆盖粘贴 10.修改配置文件my.cnf 11.

CentOS 6.5 二进制安装MySQL 5.6

-------------------------------- 下载MySQL5.6二进制包 mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz 安装相关依赖包 yum install libaio* useradd mysql 安装mysql到/data/mysql/data下 tar zxvf mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz -C /data/ mv mysql-5.6.20-linux-glibc2.5-

关于centos7如何二进制安装mysql,详细步骤!

第一步:首先在mariadb官网下载mariadb编译好的二进制压缩包https://downloads.mariadb.org/ 第二步:解压下载好的mariadb压缩包,由于下载好的是别人编译好的二进制压缩包,所以解压路径是有规定的必须在 "/usr/local/" 下,若是自己源码编译可以自行选择解压目录! tar xvf mariadb-102.23-linux-x86_64.tar.gz -C /usr/local/ · 第三步:由于解压好的文件夹(mariadb-10.2.

二进制安装 MySQL 格式待整理

[[email protected] ~]# fdisk /dev/sda WARNING: DOS-compatible mode is deprecated. It's strongly recommended to         switch off the mode (command 'c') and change display units to         sectors (command 'u'). Command (m for help): nCommand action 

centos6.5二进制安装mysql

[[email protected] ~]# yum install libaio-devel -y    #安装共享库 [[email protected] ~]# wget http://mirrors.sohu.com/mysql/My ... ux2.6-x86_64.tar.gz #下载MySQL二进制包 [[email protected] ~]# tar xf mysql-5.5.48-linux2.6-x86_64.tar.gz #解压二进制包 [[email protected