MySQL 5.6.19 二进制安装
1. 操作系统
CentOS release 6.2 (Final)
2. 创建用户和组
[root@mymaster1 ~]# groupadd mysql
[root@mymaster1 ~]# useradd -r -g mysqlmysql
3. 解压安装包(解压到你想存储数据库数据的地方)
[root@mymaster1 ~]# cd /data
[root@mymaster1 data]# tar -xzvf /root/mysql_soft/mysql-5.6.19-linux-glibc2.5-x86_64.tar.gz
[root@mymaster1 data]# ln -s mysql-5.6.19-linux-glibc2.5-x86_64 mysql
4. 查看解压情况
[root@mymaster1 data]# ll
总用量 20
lrwxrwxrwx. 1 root root 34 6月 27 15:31 mysql -> mysql-5.6.19-linux-glibc2.5-x86_64
drwxr-xr-x. 13 rootroot 4096 6月 27 15:31 mysql-5.6.19-linux-glibc2.5-x86_64
5. 改动目录所属用户和组为mysql:
[root@mymaster1 data]# cd mysql
[root@mymaster1 mysql]# chown -R mysql:mysql .
6. 安装数据库,数据存放文件夹为/data/mysql/data
[root@mymaster1 mysql]#scripts/mysql_install_db --user=mysql --basedir=/data/mysql --datadir=/data/mysql/data
WARNING: The host'mymaster1.localdomain' could not be looked up with /data/mysql/bin/resolveip.
This probably means thatyour libc libraries are not 100 % compatible
with this binary MySQLversion. The MySQL daemon, mysqld, should work
normally with the exceptionthat host name resolving will not work.
This means that youshould use IP addresses instead of hostnames
when specifying MySQLprivileges !
当出现上面警告时,解决方法是:在/etc/hosts配置文件里添加IP地址和主机名的映射
如
[root@mymaster1 Packages]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
IP地址 mymaster1.localdomain
正确的提示信息例如以下:
[root@mymaster1 mysql]#scripts/mysql_install_db --user=mysql --basedir=/data/mysql --datadir=/data/mysql/data
Installing MySQL system tables...2014-06-2716:02:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.Please use --explicit_defaults_for_timestamp server option (see documentationfor more details).
2014-06-27 16:02:45 2134 [Note] InnoDB:Using atomics to ref count buffer pool pages
2014-06-27 16:02:45 2134 [Note] InnoDB: TheInnoDB memory heap is disabled
2014-06-27 16:02:45 2134 [Note] InnoDB:Mutexes and rw_locks use GCC atomic builtins
2014-06-27 16:02:45 2134 [Note] InnoDB:Compressed tables use zlib 1.2.3
2014-06-27 16:02:45 2134 [Note] InnoDB:Using Linux native AIO
2014-06-27 16:02:45 2134 [Note] InnoDB:Using CPU crc32 instructions
2014-06-27 16:02:45 2134 [Note] InnoDB:Initializing buffer pool, size = 128.0M
2014-06-27 16:02:45 2134 [Note] InnoDB:Completed initialization of buffer pool
2014-06-27 16:02:45 2134 [Note] InnoDB: Thefirst specified data file ./ibdata1 did not exist: a new database to becreated!
2014-06-27 16:02:45 2134 [Note] InnoDB:Setting file ./ibdata1 size to 12 MB
2014-06-27 16:02:45 2134 [Note] InnoDB:Database physically writes the file full: wait...
2014-06-27 16:02:45 2134 [Note] InnoDB:Setting log file ./ib_logfile101 size to 48 MB
2014-06-27 16:02:46 2134 [Note] InnoDB:Setting log file ./ib_logfile1 size to 48 MB
2014-06-27 16:02:46 2134 [Note] InnoDB:Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-06-27 16:02:46 2134 [Warning] InnoDB:New log files created, LSN=45781
2014-06-27 16:02:46 2134 [Note] InnoDB:Doublewrite buffer not found: creating new
2014-06-27 16:02:46 2134 [Note] InnoDB:Doublewrite buffer created
2014-06-27 16:02:46 2134 [Note] InnoDB: 128rollback segment(s) are active.
2014-06-27 16:02:46 2134 [Warning] InnoDB:Creating foreign key constraint system tables.
2014-06-27 16:02:46 2134 [Note] InnoDB:Foreign key constraint system tables created
2014-06-27 16:02:46 2134 [Note] InnoDB:Creating tablespace and datafile system tables.
2014-06-27 16:02:46 2134 [Note] InnoDB:Tablespace and datafile system tables created.
2014-06-27 16:02:46 2134 [Note] InnoDB:Waiting for purge to start
2014-06-27 16:02:46 2134 [Note] InnoDB:5.6.19 started; log sequence number 0
2014-06-27 16:02:47 2134 [Note] Binlog end
2014-06-27 16:02:47 2134 [Note] InnoDB: FTSoptimize thread exiting.
2014-06-27 16:02:47 2134 [Note] InnoDB:Starting shutdown...
2014-06-27 16:02:48 2134 [Note] InnoDB:Shutdown completed; log sequence number 1625977
OK
Filling help tables...2014-06-27 16:02:48 0[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation for moredetails).
2014-06-27 16:02:48 2157 [Note] InnoDB:Using atomics to ref count buffer pool pages
2014-06-27 16:02:48 2157 [Note] InnoDB: TheInnoDB memory heap is disabled
2014-06-27 16:02:48 2157 [Note] InnoDB:Mutexes and rw_locks use GCC atomic builtins
2014-06-27 16:02:48 2157 [Note] InnoDB:Compressed tables use zlib 1.2.3
2014-06-27 16:02:48 2157 [Note] InnoDB:Using Linux native AIO
2014-06-27 16:02:48 2157 [Note] InnoDB:Using CPU crc32 instructions
2014-06-27 16:02:48 2157 [Note] InnoDB:Initializing buffer pool, size = 128.0M
2014-06-27 16:02:48 2157 [Note] InnoDB:Completed initialization of buffer pool
2014-06-27 16:02:48 2157 [Note] InnoDB:Highest supported file format is Barracuda.
2014-06-27 16:02:48 2157 [Note] InnoDB: 128rollback segment(s) are active.
2014-06-27 16:02:48 2157 [Note] InnoDB:Waiting for purge to start
2014-06-27 16:02:48 2157 [Note] InnoDB:5.6.19 started; log sequence number 1625977
2014-06-27 16:02:48 2157 [Note] Binlog end
2014-06-27 16:02:48 2157 [Note] InnoDB: FTSoptimize thread exiting.
2014-06-27 16:02:48 2157 [Note] InnoDB: Startingshutdown...
2014-06-27 16:02:50 2157 [Note] InnoDB:Shutdown completed; log sequence number 1625987
OK
To start mysqld at boot time you have tocopy
support-files/mysql.server to the rightplace for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THEMySQL root USER !
To do so, start the server, then issue thefollowing commands:
/data/mysql/bin/mysqladmin -u root password 'new-password'
/data/mysql/bin/mysqladmin -u root -h mymaster1.localdomain password'new-password'
Alternatively you can run:
/data/mysql/bin/mysql_secure_installation
which will also give you the option ofremoving the test
databases and anonymous user created bydefault. This is
strongly recommended for productionservers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd. ; /data/mysql/bin/mysqld_safe &
You can test the MySQL daemon withmysql-test-run.pl
cdmysql-test ; perl mysql-test-run.pl
Please report any problems athttp://bugs.mysql.com/
The latest information about MySQL isavailable on the web at
http://www.mysql.com
Support MySQL by buying support/licenses athttp://shop.mysql.com
New default config file was created as/data/mysql/my.cnf and
will be used by default by the server whenyou start it.
You may edit this file to change serversettings
7. 改动相关文件夹权限。提高安全性:
[root@mymaster1 mysql]# chown -R root .
[root@mymaster1 mysql]# chown -R mysql data
8. 配置MySQL服务为主机服务。即能用service mysql start启动服务
[root@mymaster1 mysql]# cpsupport-files/mysql.server /etc/init.d/mysql
[root@mymaster1 mysql]# vi /etc/init.d/mysql
把以下的
basedir=
datadir=
改动为
basedir=/data/mysql
datadir=/data/mysql/data
9. 启动数据库
[root@mymaster1 mysql]# service mysql start
Starting MySQL[确定]
10. 改动数据库rootpassword
[root@mymaster1 mysql]#/data/mysql/bin/mysqladmin -u root password 'wengjixi'
[root@mymaster1 mysql]#/data/mysql/bin/mysqladmin -u root -h mymaster1.localdomain password 'wengjixi'
11. 改动环境变量,把mysql运行文件路径加入到环境变量中
[root@mymaster1 mysql]# vi /etc/profile
PATH=$PATH:/data/mysql/bin
export PATH
[root@mymaster1 mysql]# source /etc/profile
12. 測试登录
[root@mymaster1 mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.19 MySQL CommunityServer (GPL)
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarksof their respective
owners.
Type 'help;' or '\h' for help. Type '\c' toclear the current input statement.
mysql>
mysql> show variables like '%data%';
+-------------------------------+------------------------+
| Variable_name | Value |
+-------------------------------+------------------------+
| character_set_database | latin1 |
| collation_database | latin1_swedish_ci |
| datadir | /data/mysql/data/
版权声明:本文博主原创文章,博客,未经同意不得转载。
MySQL 5.6.19 二进制安装的更多相关文章
- linux下Mysql 8.0.19 编译安装
1 前言 linux下安装MySQL的方式有很多种,包括以仓库的方式安装(yum,apt,zypper),以包的方式安装(rpm,deb),以docker方式安装,从压缩包解压安装,从源码编译安装,这 ...
- MySQL 5.7.19 简易安装、卸载教程
前言:传统的 exe 文件安装的MySQL,安装后特别难卸载,而且一旦处理不好,就容易出错,想再安装别的版本也不容易.因为这种方式的安装,虽然是不断的下一步,但是卸载的时候需要处理很多,在本文最后,有 ...
- MySQL 5.6.19编译安装
1.创建mysql安装目录.mysql用户 [root@serv19 ~]# mkdir -p /u01/mysql/data [root@serv19 ~]# groupadd mysql [roo ...
- win系统 Mysql 5.7.19 zip 安装
1 安装运行环境 VC++ 2013 2 下载 https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19-winx64.zip 3 解压 4 ...
- Linux mysql 5.5.10 二进制安装过程记录和 修改 密码 登录
1.useradd clouder2.解压缩mysql.tar.bz2到/home/clouder2.mv /etc/my.cnf /etc/my.cnf.bak3./home/clouder/mys ...
- (0.2.3)Mysql安装——二进制安装
Linux平台下二进制方式安装卸载mysql 本章节:二进制安装mysql 目录: 1.基于Linux平台的Mysql项目场景介绍 2.mysql数据库运行环境准备-最优配置 3.如何下载mysql数 ...
- centos 7 MysSQL 5.7.23 二进制安装
MySQL 5.7.23 二进制安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos ...
- centos 7 MysSQL 5.6.39 二进制安装
MySQL 5.6.39 二进制安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos ...
- Mysql的二进制安装和基础入门操作
前言:Mysql数据库,知识非常的多,要想学精学通这块知识,估计也要花费和学linux一样的精力和时间.小编也是只会些毛皮,给大家分享一下~ 一.MySQL安装 (1)安装方式: 1 .程序包yum安 ...
随机推荐
- 提交(post)xml文件给指定url的2种方法
原文:提交(post)xml文件给指定url的2种方法 1 这段代码是在网上搜到的,拿来共享,项目正好要用到.其中的data你只需要传递一个xml字符串就可以 protected string ...
- CC++初学者编程教程(9) Windows8.1安装VS2013并捆绑QT与编程助手
我们在Windows8.1安装VS2013并捆绑QT与编程助手需要下列文件. 2. 在虚拟机中开启Windows8.1 3.然后选择VS2013的安装镜像. 4.将镜像复制到虚拟机. 5.我们装载这个 ...
- 向未声明的 JavaScript 变量来分配值
如果您把值赋给尚未声明的变量,该变量将被自动作为全局变量声明. 这条语句: carname="Volvo"; 将声明一个全局变量 carname,即使它在函数内执行.
- 网易云课堂_程序设计入门-C语言_第三周:循环_1奇偶个数
1 奇偶个数(5分) 题目内容: 你的程序要读入一系列正整数数据,输入-1表示输入结束,-1本身不是输入的数据.程序输出读到的数据中的奇数和偶数的个数. 输入格式: 一系列正整数,整数的范围是(0,1 ...
- BZOJ-1923-外星千足虫-SDOI2010
描写叙述 分析 首先看上去这貌似是一个高斯消元的题目, 直觉吧- 每次给出的就相当于是一个方程. 然后非常easy想到n条虫子n个x, x_i的系数为0表示这个方程中没有i, 否则为1. 然后系数乘以 ...
- POJ3253 Fence Repair(贪心)
分割木板的顺序是自由的,所以每次选择两块最短的板,组合在一起,增加队列,原来两个板出队,直到队列中为空或者仅仅剩下一个板时结束.这里使用优先队列较为方便. #include<iostream&g ...
- Java操作XML文件 dom4j 篇
在项目中,我们很多都用到了xml文件,无论是参数配置还是与其它系统的数据交互.今天就来讲一下Java 中使用dom4j来操作XML文件. 我们需要引入的包: //文件包 import java.io. ...
- javascript高级程序设计一(80-116)
81.函数内部属性:arguments.arguments.callee.this. window.color = "red"; var o={color:"blue&q ...
- 折叠Collapse插件
实例 折叠(Collapse)插件可以很容易地让页面区域折叠起来.无论您用它来创建折叠导航还是内容面板,它都允许很多内容选项. .collapse 隐藏内容. .collapse.in 显示内容. . ...
- 在webstrorm中配置好es6 babel
第一步,新建一个项目,我这里建立了基于express 的node项目 第二步:将JavaScript语言版本切换为ECMAScript6 点击File —>settings,弹出设置框.把js的 ...