myql 5.6 安装
环境: centos 6.5 192.168.9.28 4核4G 虚拟机
一. 安装编译源码所需要的工具和库
[root@localhost ~]# yum -y install gcc gcc-c++ make ncurses-devel perl
[root@localhost soft]# ls
cmake-2.8.6.tar.gz mysql-5.6.35.tar.gz
[root@localhost soft]# tar xf cmake-2.8.6.tar.gz -C /usr/src
[root@localhost soft]# cd /usr/src/cmake-2.8.6/
[root@localhost cmake-2.8.6]# ls
bootstrap cmake_uninstall.cmake.in Docs
ChangeLog.manual CompileFlags.cmake doxygen.config
ChangeLog.txt configure Example
cmake.1 Copyright.txt Modules
CMakeCPack.cmake CTestConfig.cmake Readme.txt
CMakeCPackOptions.cmake.in CTestCustom.cmake.in Source
CMakeGraphVizOptions.cmake CTestCustom.ctest.in Templates
CMakeLists.txt DartConfig.cmake Tests
CMakeLogo.gif DartLocal.conf.in Utilities
[root@localhost cmake-2.8.6]# ./bootstrap
[root@localhost cmake-2.8.6]# make && make install
二.设置mysql用户组和用户
[root@localhost cmake-2.8.6]# groupadd mysql
[root@localhost cmake-2.8.6]# useradd -r -g mysql mysql
三. 新建mysql 所需要的数据目录
[root@localhost cmake-2.8.6]# mkdir -p /usr/local/mysql
[root@localhost cmake-2.8.6]# mkdir -p /data/mysqldb
[root@localhost soft]# tar xf mysql-5.6.35.tar.gz -C /usr/src
[root@localhost soft]# cd /usr/src/mysql-5.6.35/
四.编译安装mysql
[root@localhost mysql-5.6.35]# cmake -DCMAK_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1
[root@localhost mysql-5.6.35]# make && make install
五.修改mysql目录的所有者和属组
[root@localhost mysql-5.6.35]# chown -R mysql.mysql /data/mysqldb/
[root@localhost mysql-5.6.35]# chown -R mysql.mysql /usr/local/mysql/
六. 导入mysql的配置文件,以下myql配置文件根据服务器的配置不同需要做出相应的更改。
也可以启动mysql时,根据错误日志内容做出相应的更改。
[root@localhost etc]# egrep -v "^$|^#" ./my.cnf
[mysqld]
datadir= /data/mysqldb
socket=/usr/local/mysql/mysql.sock
user=mysql
port = 3306
server_id = 11
autocommit = 0
character_set_server=utf8
max_allowed_packet = 52m
max-connections = 1000
interactive_timeout = 1800
wait_timeout = 1800
read_buffer_size = 16777216
read_rnd_buffer_size = 33554432
sort_buffer_size = 33554432
tmp_table_size = 67108864
tmpdir = /tmp
log-bin=mysql-bin
binlog-format = ROW
relay-log = mysql-relay-bin
log-slave-updates = 1
read_only = 0
sync_binlog = 1
plugin-load = "rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"
rpl-semi-sync-master-enabled = 1
rpl-semi-sync-slave-enabled = 1
slave-skip-errors = ddl_exist_errors
relay-log-info-repository = TABLE
relay_log_recovery = 1
master_info_repository = TABLE
log_error = error.log
slow_query_log = 1
slow_query_log_file = slow.log
log_queries_not_using_indexes = 1
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_throttle_queries_not_using_indexes = 10
expire_logs_days = 90
long_query_time = 2
min_examined_row_limit = 100
innodb_page_size = 16384
innodb_buffer_pool_size = 4G
innodb_buffer_pool_instances = 8
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_lru_scan_depth = 2000
innodb_lock_wait_timeout = 5
innodb_io_capacity = 4000
innodb_io_capacity_max = 8000
innodb_flush_method = O_DIRECT
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
innodb_undo_logs = 128
innodb_undo_tablespaces = 3
innodb_flush_neighbors = 1
innodb_log_file_size = 4G
innodb_log_buffer_size = 16777216
innodb_purge_threads = 4
innodb_large_prefix = 1
innodb_thread_concurrency = 64
innodb_print_all_deadlocks = 1
innodb_strict_mode = 1
innodb_flush_log_at_trx_commit=1
innodb_sort_buffer_size = 67108864
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
symbolic-links=0
七. 初始化数据库
[root@localhost ~]# cd /usr/local/mysql/
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysqldb
八. 复制mysql启动脚本及加入PATH 路径
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysqld
PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
[root@localhost mysql]# source /etc/profile
九 启动myql 并加入开机自启动
[root@localhost mysql]# /etc/init.d/mysqld start
[root@localhost mysql]# netstat -lnpt | grep 3306
tcp 0 0 :::3306 :::* LISTEN 1361/mysqld
注:在启动mysql的时候,可能会遇到mysql 启动报错的问题,查看错误日志报:
十.设置mysql 的root 密码
Enter password: 输入123456
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.35-log Source distribution
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
至此mysql 5.6 安装完毕
myql 5.6 安装的更多相关文章
- MYSQL数据库的安装,配置文件,登入
07.13自我总结 MYSQL数据库 一.MYQL数据库的安装 可以去mysql官网下载mysql压缩包 运行程序:在bin文件夹中,其中客户端运行文件是mysql.exe,服务端运行文件为mysql ...
- LAMP架构上(一)
第十七课LAMP架构上(一) 目录 一.LAMP架构介绍 二.MySQL.MariaDB介绍 三.MySQL安装 四.MariaDB安装 五.Apache安装 六.安装PHP5 七.安装PHP7 八. ...
- 使用docker安装myql/redis等软件
使用docker安装myql/redis等软件 概述 基本命令 安装mysql 安装redis 概述 在开发时经常需要安装各种软件,有时甚至为了验证一个命令不得不安装配置一个缓存.数据库.MQ等,耽误 ...
- Linux 安装MySQL
安装配置 [root@iZ28gvqe4biZ ~]# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.r ...
- mysql5.6.23免安装配置
1.官网下载,并解压 2.环境变量,path下,追加mysql的bin路径D:\Program Files\mysql\bin; 3.mysql目录下的my-default.ini重命名为my.ini ...
- Linux~centos上安装.netcore,HelloWorld归来!
对于跨平台的.netCore来说,让它的程序运行在Linux系统上已经成为必然,也是一种趋势,毕竟我们的很多服务都放在linux服务器上(redis,mongodb,myql,fastDFS,luce ...
- redhat6.4上安装mysql
1.挂载操作系统介质 [root@server- ~]# mkdir -p /media/dvd [root@server- ~]# -20130130.0-Server-x86_64-DVD1.is ...
- centos7安装mysql
centos7安装mysql 1 查找系统是否安装了myql rpm -q mysql mysql-server1.1如果安装了.就删除 sudo yum -y remove mysql mysql- ...
- Linux(Ubuntu)下MySQL的安装与配置
转自:http://www.2cto.com/database/201401/273423.html 在Linux下MySQL的安装,我一直觉得挺麻烦的,因为之前安装时就是由于复杂的配置导致有点晕.今 ...
随机推荐
- web前端生成图片之探索踩坑
前段时间,产品和运营整了个非常变态的需求,要求将一个活动页面输出为图片,然后用户进行分享 开始以为是用户自己手动截图分享,没想到后来不是,细思极恐,感叹需求之变态. 从网上找了N个方案,最后确定使用 ...
- Codeforces 898 A. Rounding
A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
- Codechef Chef and Triangles(离散化+区间并集)
题目链接 Chef and Triangles 先排序,然后得到$m - 1$个区间: $(a[2] - a[1], a[2] + a[1])$ $(a[3] - a[2], a[3] + a[2]) ...
- codevs——3111 CYD啃骨头(背包)
裸的01背包 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 题目描述 Description CYD吃饭时有N个骨头可以啃,但CYD要午睡了 ...
- SecureCRT鼠标快速复制粘贴
- 代码统计利器--CLOC
MAC下安装命令:$ brew install cloc 其他的linux安装 $ aptitude install cloc 使用方法.到目录下运行: $ cloc . The default ou ...
- JSONModel解析Dictionary To Model /JSON To Model
你在把字典转成object的时候还在按下面这样: self.id = [jsonDict objectForKey:@"id"]; self.name = [jsonDict ob ...
- Speech to Text for iOS
找了一下 speech to text 可以用的 SDK for iOS 以下幾種方案: NDEV Mobile (有免費方案,不過似乎不支援離線,客戶清單中有 wallmart,支援不少語言) iS ...
- python __new__和__init__的区别
http://www.cnblogs.com/tuzkee/p/3540293.html 继承自object的新式类才有__new__ __new__至少要有一个参数cls,代表要实例化的类,此参数在 ...
- BRDF
Q radiant energy: J Φ radiant flux: W dQ/dt E irradiance: W/m2 dΦ/dA I radiant intersity: W/sr d ...