MySQL 5.6.19 二进制安装

1.        操作系统

CentOS release 6.2 (Final)

2.        创建用户和组

[[email protected]1 ~]# groupadd mysql

[[email protected] ~]# useradd -r -g mysqlmysql

3.        解压安装包(解压到你想存储数据库数据的地方)

[[email protected] ~]# cd /data

[[email protected] data]# tar -xzvf /root/mysql_soft/mysql-5.6.19-linux-glibc2.5-x86_64.tar.gz

[[email protected] data]# ln -s mysql-5.6.19-linux-glibc2.5-x86_64 mysql

4.        查看解压情况

[[email protected] 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:

[[email protected] data]# cd mysql

[[email protected] mysql]# chown -R mysql:mysql .

6.        安装数据库,数据存放文件夹为/data/mysql/data

[[email protected] 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地址和主机名的映射

[[email protected] Packages]# cat /etc/hosts

127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4

::1        localhost localhost.localdomain localhost6 localhost6.localdomain6

IP地址  mymaster1.localdomain

正确的提示信息例如以下:

[[email protected] 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.        改动相关文件夹权限。提高安全性:

[[email protected] mysql]# chown -R root .

[[email protected] mysql]# chown -R mysql data

8.        配置MySQL服务为主机服务。即能用service mysql start启动服务

[[email protected] mysql]# cpsupport-files/mysql.server /etc/init.d/mysql

[[email protected] mysql]# vi /etc/init.d/mysql

把以下的

basedir=

datadir=

改动为

basedir=/data/mysql

datadir=/data/mysql/data

9.        启动数据库

[[email protected] mysql]# service mysql start

Starting MySQL[确定]

10.    改动数据库rootpassword

[[email protected] mysql]#/data/mysql/bin/mysqladmin -u root password ‘wengjixi‘

[[email protected] mysql]#/data/mysql/bin/mysqladmin -u root -h mymaster1.localdomain password ‘wengjixi‘

11.    改动环境变量,把mysql运行文件路径加入到环境变量中

[[email protected] mysql]# vi /etc/profile

PATH=$PATH:/data/mysql/bin

export PATH

[[email protected] mysql]# source /etc/profile

12.    測试登录

[[email protected] 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/

版权声明:本文博主原创文章,博客,未经同意不得转载。

时间: 2024-11-08 17:39:58

MySQL 5.6.19 二进制安装的相关文章

MySQL 5.6.19 二进制的安装方式

1.        操作系统 CentOS release 6.2 (Final) 2.        创建用户和组 [[email protected] ~]# groupadd mysql [[email protected] ~]# useradd -r -g mysqlmysql 3.        解压安装包(解压到你想存储数据库数据的地方) [[email protected] ~]# cd /data [[email protected] data]# tar -xzvf /roo

MySQL 5.7.22 二进制安装

MySQL 5.7.22 二进制安装 一.到官网下载mysql-5.7.22二进制包 二.创建mysql用户: useradd mysql -s /sbin/nologin -M 三.解压mysql-5.7.22-el7-x86_64.tar.gz : tar xf mysql-5.7.22-el7-x86_64.tar.gz && mv mysql-5.7.22-el7-x86_64.tar.gz /opt/mysql 四.创建相关目录: cd /opt/mysql mkdir {dat

CentOS7/64位环境安装Mysql 5.7.19二进制包教程

1.下载mysql 在官网:http://dev.mysql.com/downloads/mysql/ 中,选择二进制的mysql版本下载: #wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz 2.解压 #tar -xzvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz  --解压 #mv mysql-5.7.18-lin

mysql之source编译,二进制安装以及权限分配等

MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下公司,由于其体积小.速度快.总体拥有成本低,尤其是开放源码这一特点,一般中小型网站的开发都选择 MySQL 作为网站数据库. mysql:流程图 mysql内部结构: 两种安装方式:源码编译,二进制安装. mysql source安装5.5 依赖: [[email protected]  tools]# yum install -y cmake [[email protected]  tools]

mysql 5.7.12二进制安装

1.my.cnf配置文件参数:vim /etc/my.cnf [client] port = 3306 socket = /tmp/mysql.sock [mysql] no-auto-rehash [mysqld] user = mysql port = 3306 socket = /tmp/mysql.sock basedir = /aliyun/server/mysql-5.7.12/ datadir = /data/mysql/data/ open_files_limit = 1024

Mysql 5.6版本二进制安装

时间:2018.7.30作者:李强参考:man,info,magedu讲义,万能的internet实验环境:VMware? Workstation 12 Pro ,Centos 6.9,Centos 7.4,SecureCRT Version 8.1.4声明:以下英文纯属个人翻译,英文B级,欢迎纠正,以下内容纯属个人理解,并没有对错,只是参考,盗版不纠,才能有限,希望不误人子弟为好.版本:v1-2018.7.30 参考资料 1.https://www.cnblogs.com/BrightMoon

MySQL 8.0.13 二进制安装

MySQL 8.0 二进制安装大致与MySQL 5.7 类似 1.查询删除原有mysql使用rpm -qa | grep mysql 或mariadb 搜索 mysql,如果存在,使用rpm -e --nodeps mariadb-全部删除,或使用yum remove mysql mysql-server mysql-libs compat-mysql51全部删除:2.下载所需依赖包yum remove libnuma.so.1yum install make cmake libaio wget

mysql 5.7.19 二进制最新安装

############################## 2017-08-08  笔记 一.优化部分 1.操作系统参数调优 2.数据库参数调优 3.防火墙设置等 ############################# 二.安装部分 1.创建用户和组 # groupadd mysql # useradd -g mysql mysql 2.创建数据库安装目录.授权 # mkdir /mysql /mysql/data /mysql/log # chown -R mysql:mysql /us

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 我的电脑->属性->高级系统设置->高级->环境变量.在系统变量中点击path,然后选择编辑.把”c:\mysql-5.7.19-winx64\bin; 5 配置c:\mysql-5.7.19-winx64\my.ini 6 初始化数据库 : mysqld --initialize-