一般我们安装mysql采用二进制安装的方式就足以满足我们的生产环境了,不过需要我们配置my.cnf文件

从官网下载二进制MySQL,选择Linux-Generic,最后这两个是二进制包

http://downloads.mysql.com/archives/community/

650) this.width=650;" title="1.JPG" alt="wKioL1cz6R_TsJjYAAEmvaze534639.jpg" src="http://s4.51cto.com/wyfs02/M00/7F/FC/wKioL1cz6R_TsJjYAAEmvaze534639.jpg" />

[root@HE1 ~]#tar xvf mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz

mv mysql-5.6.16-linux-glibc2.5-x86_64 /usr/local/mysql

[root@HE1mysql]#groupadd mysql -g 512
[root@HE1mysql]#useradd-u 512 -g mysql -s /sbin/nologin -d /home/mysql mysql
[root@HE1mysql]#mkdir-p /data/mysql
[root@HE1mysql]#mkdir-p /log/mysql
[root@HE1mysql]#chown-R mysql:mysql /data/mysql
[root@HE1mysql]#chown -R mysql:mysql/usr/local/mysql
[root@HE1mysql]#chown-R mysql:mysql /log
[root@HE1mysql]#echo "export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib">>/etc/profile
[root@HE1mysql]#source /etc/profile

[root@HE1~]# cat /etc/my.cnf

[client]
#port        =3306
#socket        =/tmp/mysql.sock
#default-character-set=utf8
 
[mysql]
#default-character-set=utf8
 
[mysqld]
port        =3306
socket        =/tmp/mysql.sock
basedir        =/usr/local/mysql
datadir        =/data/mysql
open_files_limit    = 3072
back_log= 103
max_connections= 512
max_connect_errors= 100000
table_open_cache= 512
external-locking= FALSE
max_allowed_packet= 32M
sort_buffer_size= 2M
join_buffer_size= 2M
thread_cache_size= 51
query_cache_size= 32M
tmp_table_size= 96M
max_heap_table_size= 96M
slow_query_log= 1
slow_query_log_file= /data/mysql/slow.log
log-error= /data/mysql/error.log
long_query_time= 0.05
server-id= 1
log-bin =/data/mysql/mysql-bin
sync_binlog= 1
binlog_cache_size= 4M
max_binlog_cache_size= 8M
max_binlog_size= 1024M
expire_logs_days= 7
key_buffer_size= 32M
read_buffer_size= 1M
read_rnd_buffer_size= 16M
bulk_insert_buffer_size= 64M
character-set-server=utf8
default-storage-engine= InnoDB
binlog_format=row
 
#gtid_mode=on
#log_slave_updates=1
#enforce_gtid_consistency=1
 
transaction_isolation= REPEATABLE-READ
innodb_additional_mem_pool_size= 16M
innodb_buffer_pool_size= 1434M
innodb_data_file_path= ibdata1:1024M:autoextend
innodb_flush_log_at_trx_commit= 1
innodb_log_buffer_size= 16M
innodb_log_file_size= 256M
innodb_log_files_in_group= 2
innodb_max_dirty_pages_pct= 50
innodb_file_per_table= 1
innodb_locks_unsafe_for_binlog= 0
[mysqldump]
quick
max_allowed_packet= 32M

[root@HE1bin]# ./mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql--defaults-file=/etc/my.cnf --user=mysql

8.进到bin下./mysqld_safe--help看下

[root@HE1bin]# ./mysqld_safe --defaults-file=/etc/my.cnf &

mysql>delete from mysql.user where user!='root' or host!='localhost';
Query OK,5 rows affected (0.01 sec)
 
mysql>update user set password=password('root123') where user='root';
Query OK,1 row affected (0.00 sec)
mysql>grant select,delete,update,insert on *.* to helei@'192.168.1.%' identified by 'root123';
Query OK,0 rows affected (0.00 sec)
mysql>grant all privileges on *.* to root@'192.168.1.%' identified by 'root123';
Query OK,0 rows affected (0.28 sec)
mysql>flush privileges;
Query OK,0 rows affected (0.00 sec)

mysql>select user,host,password from mysql.user;

+-------+-------------+-------------------------------------------+

|user  | host        | password                                  |

+-------+-------------+-------------------------------------------+

|root  | localhost   | *A9F635AE07EC0944EFFE52FD0A86327B98ADDED7|

|root  | 192.168.1.% |*A9F635AE07EC0944EFFE52FD0A86327B98ADDED7 |

| helei |192.168.1.% | *A9F635AE07EC0944EFFE52FD0A86327B98ADDED7 |

+-------+-------------+-------------------------------------------+

3 rows inset (0.00 sec)

[root@HE1bin]# ./mysqladmin -uroot -p shutdown

Enterpassword:

16031700:53:52 mysqld_safe mysqld from pid file /data/mysql/HE1.pid ended

[1]+  Done                    ./mysqld_safe--defaults-file=/etc/my.cnf

配置mysql

[root@HE1mysql]# cp support-files/mysql.server /etc/init.d/mysqld

chmod700 /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig--level 2345 mysqld on

[root@HE1~]# /etc/init.d/mysqld status

ERROR! MySQL is not running

[root@HE1~]# /etc/init.d/mysqld start

StartingMySQL.. SUCCESS!

TCP和套接字连接方式

[root@HE1 bin]#mysql -p -S /data/mysql.sock

Enter password:

Welcome to the MySQLmonitor.  Commands end with ; or \g.

Your MySQLconnection id is 6

Server version:5.6.16-log MySQL Community Server (GPL)

Copyright (c) 2000,2014, Oracle and/or its affiliates. All rights reserved.

Oracle is aregistered trademark of Oracle Corporation and/or its

affiliates. Othernames may be trademarks of their respective

owners.

Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.

mysql> quit

Bye

[root@HE1~]# /etc/init.d/mysqld stop

Shuttingdown MySQL.. SUCCESS!

[root@HE1~]# /etc/init.d/mysqld status

ERROR! MySQL is not running

本文出自 “岁伏” 博客,请务必保留此出处http://suifu.blog.51cto.com/9167728/1753965

CentOS6+MySQL5.6二进制安装的更多相关文章

  1. Linux中MySQL5.6编译安装与MySQL5.7二进制安装步骤

    首先,介绍一下MySQL的几种安装方式 1.RPM.Yum 的安装方式:安装方便.安装速度快,无法定制 2.二进制:不需要安装,解压即可使用,不能定制功能 3.编译安装:可定制,安装慢. 编译安装中需 ...

  2. [sql]mysql5.6cmake安装/mysql5.7二进制安装

    centos7上cmake编译安装mysql-5.6.36.tar.gz 系统环境 - 环境(安装前规划好主机名,mysql编译过程会用) [root@n1 mysql-5.6.36]# cat /e ...

  3. Centos7.3 之mysql5.7二进制安装

    #!/bin/bash #注意,该脚本是在centos7.3非生产环境下测试的,其他版本的系统可能不适用,要根据情况修改.需要先下载好mysql二进制包到本地(我一般都是在root家目录下操作,文件也 ...

  4. centos6下通用二进制安装mysql5.5.33

    mysql5.5通用二进制格式安装方法 1.解压到 /usr/local 目录 # tar xf mysql-5.5.33-linux2.6-x86_64.tar.gz -C /usr/local 2 ...

  5. MySQL5.7二进制安装

    MySQL-5.7.14从零开始-安装 首先我们要选择下载MySQL的版本: 登录官方网站下载:https://dev.mysql.com/downloads/mysql/ 下面我们选择5.7.14的 ...

  6. Linux下Mysql5.6 二进制安装

    1.1下载二进制安装包 wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.40-linux-glibc2.12-x86_64.t ...

  7. ubuntu mysql5.6二进制安装

    200 ? "200px" : this.width)!important;} --> 介绍 以前一直使用centos今天需要对一台ubantu的系统安装mysql,虽然它也 ...

  8. centos6二进制安装mysql5.5

    centos 6.5,安装mysql 5.5.60 所需安装包mysql-5.5.60-linux-glibc2.12-x86_64.tar.gz.ncurses-devel-5.7-4.200902 ...

  9. MySQL5.7 linux二进制安装

    200 ? "200px" : this.width)!important;} --> 介绍 MySQL5.7出来也有大半年了,业内也一直在宣传5.7有多么的N,官网的也是宣 ...

随机推荐

  1. opencart配置mail服务

    编辑mail配置,如下图所示 如果sever开启了SSL,则端口改成465 在Contant Us页面留言,发送成功则配置完成

  2. js判断各个浏览器

    其实,实际写js的过程中,用功能判断”鸭shi辨形“的方法就可以了,不过,很多地方考试还是会问.所以总结一下,大部分都是分析navigator来实现的. var ua=navigator.userAg ...

  3. POJ Sudoku 数独填数 DFS

    题目链接:Sudoku Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 18105   Accepted: 8772   Sp ...

  4. my97datepicker开始日期小于结束日期格式化时间精确届时分秒

    my97datepicker开始日期小于结束日期格式化时间精确到时分秒 一 , 需求: 结束时间 > 开始时间, 不符合的时间段不能选择.比如我选择开始日期是7月28,那结束的日期将只能从7月2 ...

  5. 分享我们项目中基于EF事务机制的架构 【转载】

    http://www.cnblogs.com/leotsai/p/how-to-use-entity-framework-transaction-scope.html 写在前面: 1. 本文中单元测试 ...

  6. Struts2--Action属性接收参数

    1. JSP文件调用格式: <a href="user/user!add?name=a&age=8">添加用户</a> 2. struts.xml文 ...

  7. column name is keyword from

    mysql: select tablename.from from tablename; postgresql: select "from" from tablename; sql ...

  8. STM32 IAP 在线升级详解(转)

    源:http://blog.csdn.net/yx_l128125/article/details/12992773 (扩展-IAP主要用于产品出厂后应用程序的更新作用,考虑到出厂时要先烧写IAP   ...

  9. (二)Jquery Mobile介绍以及Jquery Mobile页面与对话框

    Jquery Mobile介绍以及Jquery Mobile页面与对话框  一. Adobe Dreamweaver CS6 环境 最新版本的cs6会支持JM的使用,有自动提示功能,很强大.安装说明地 ...

  10. ibatis一对多 数据库设计及实现

    iBatis的多表关联. ibatis的表关联,和数据库语句无关,是在Java程序中,把若干语句的结果关联到一起.这种关联形式,虽然在大数据量时是很奢侈的行为,但是看起来很干净,用起来也很方便. 这里 ...