hadoop生态搭建(3节点)-05.mysql配置_单节点
# ==================================================================node1
# ==================================================================安装 mysql
# 查看当前安装的mariadb包
rpm -qa | grep mariadb # 有就将它们统统强制性卸载掉:
rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64 rpm -qa | grep -i mysql # 创建用户组和用户
groupadd mysql
useradd -r -g mysql -s /bin/false mysql # 解压到指定目录
tar -zxvf ~/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz -C /usr/local
mv /usr/local/mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/mysql
rm –r ~/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
# ==================================================================环境变量
vi /etc/profile # 在export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL下添加
export JAVA_HOME=/usr/java/jdk1.8.0_111
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.12
export HADOOP_HOME=/usr/local/hadoop-2.7.6
export MYSQL_HOME=/usr/local/mysql export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$ZOOKEEPER_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$MYSQL_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native # 使环境变量生效
source /etc/profile # 查看配置结果
echo $MYSQL_HOME
# ==================================================================配置 mysql
mkdir $MYSQL_HOME/data
mkdir $MYSQL_HOME/run
mkdir $MYSQL_HOME/logs
# mkdir /var/lib/mysql vi /etc/my.cnf [client]
default-character-set=utf8
# character-set-client=utf8
loose-default-character-set=utf8
port=3306
# socket=/var/lib/mysql/mysql.sock
socket=/usr/local/mysql/mysql.sock [mysqld]
server_id=1
port=3306
character_set_server=utf8
init_connect='SET NAMES utf8'
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
# socket=/var/lib/mysql/mysql.sock
socket=/usr/local/mysql/mysql.sock
#不区分大小写
lower_case_table_names=1
log-error=/usr/local/mysql/logs/mysqld.log
pid-file=/usr/local/mysql/run/mysqld.pid
default_storage_engine=InnoDB
slow_query_log=1
slow_query_log_file=/usr/local/mysql/logs/mysql_slow_query.log
long_query_time=5 # chmod 777 /var/lib/mysql
chown -R mysql:mysql $MYSQL_HOME # 添加开机启动
cp $MYSQL_HOME/support-files/mysql.server /etc/rc.d/init.d/mysqld
vi /etc/rc.d/init.d/mysqld basedir=/usr/local/mysql
datadir=/usr/local/mysql/data # 增加mysqld服务控制脚本执行权限
chmod +x /etc/rc.d/init.d/mysqld # 将mysqld服务加入到系统服务
chkconfig --add mysqld # 检查mysqld服务是否已经生效
chkconfig --list mysqld # 初始化数据库
$MYSQL_HOME/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data # 生成了临时密码
# 执行以下命令创建RSA private key
$MYSQL_HOME/bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data grep 'temporary password' /usr/local/mysql/logs/mysqld.log # 启动mysql
systemctl start mysqld.service # service mysqld start
# 启动数据库
# ./mysqld_safe --user=mysql &; mysql -uroot -p # 如果出现错误 需要添加软连接
# ln -s /usr/local/mysql/bin/mysql /usr/bin # 修改密码
> alter user 'root'@'localhost' identified by '123456';
> flush privileges; # 无法远程连接时
> use mysql;
> update user set host = '%' where user = 'root';
> select host, user from user; # 如果要安装Hive,再创建Hive数据库和用户 再执行下面的语句
> create database hive character set utf8 ;
> create user 'hive'@'%'identified by 'Hive-123';
> grant all privileges on *.* to 'hive'@'%';
> flush privileges;
show databases; quit; reboot # 重启验证有效后再进行快照
mysql -uroot -p quit; shutdown -h now
# mysql
# ==================================================================安装 mysql (windows)
my.ini [mysqld]
server-id=1
max_connections=2000
character-set-server = utf8
port=3306
#skip-grant-tables
innodb_file_per_table=0 innodb_flush_log_at_trx_commit=0 # dos下注册服务
mysqld --defaults-file=my.ini --initialize-insecure # 安装
mysqld --install mysql57 # 启动服务
net start mysql57 mysql -u root -p > use mysql; > update user set authentication_string=password('123456') where user='root'; > flush privileges; > exit
hadoop生态搭建(3节点)-05.mysql配置_单节点的更多相关文章
- hadoop生态搭建(3节点)-17.sqoop配置_单节点
# ==================================================================安装 sqoop tar -zxvf ~/sqoop-1.4.7 ...
- hadoop生态搭建(3节点)
软件:CentOS-7 VMware12 SSHSecureShellClient shell工具:Xshell 规划 vm网络配置 01.基础配置 02.ssh配置 03.zookeep ...
- js 节点 document html css 表单节点操作
js 节点 document html css 表单节点操作 节点操作:访问.属性.创建 (1)节点的访问:firstChild.lastChild.childNodes.parentChild(父子 ...
- hadoop生态搭建(3节点)-13.mongodb配置
# 13.mongodb配置_副本集_认证授权# ==================================================================安装 mongod ...
- hadoop生态搭建(3节点)-12.rabbitmq配置
# 安装 需要相关包# ==================================================================node1 node2 node3 yum ...
- hadoop生态搭建(3节点)-08.kafka配置
如果之前没有安装jdk和zookeeper,安装了的请直接跳过 # https://www.oracle.com/technetwork/java/javase/downloads/java-arch ...
- hadoop生态搭建(3节点)-10.spark配置
# https://www.scala-lang.org/download/2.12.4.html# ================================================= ...
- hadoop生态搭建(3节点)-15.Nginx_Keepalived_Tomcat配置
# Nginx+Tomcat搭建高可用服务器名称 预装软件 IP地址Nginx服务器 Nginx1 192.168.6.131Nginx服务器 Nginx2 192.168.6.132 # ===== ...
- hadoop生态搭建(3节点)-04.hadoop配置
如果之前没有安装jdk和zookeeper,安装了的请直接跳过 # https://www.oracle.com/technetwork/java/javase/downloads/java-arch ...
随机推荐
- Oracle 查看表占用的空间大小
select TABLE_NAME , num_rows * avg_row_len /1024/1024 AS KJfrom ALL_tables WHERE TABLE_NAME IN (sele ...
- Jmeter性能测试 入门--转载
转载: Jmeter性能测试 入门 Jmeter是一款优秀的开源测试工具, 是每个资深测试工程师,必须掌握的测试工具,熟练使用Jmeter能大大提高工作效率. 熟练使用Jmeter后, 能用Jmete ...
- java:网络通讯
网络标准模型:开放式系统模型OSI https://www.cnblogs.com/lydit/articles/4499928.html 理解Scoket通讯:https://www.cnblogs ...
- Web系统常见安全漏洞及解决方案-SQL盲注
关于web安全测试,目前主要有以下几种攻击方法: 1.XSS 2.SQL注入 3.跨目录访问 4.缓冲区溢出 5.cookies修改 6.Htth方法篡改(包括隐藏字段修改和参数修改) 7.CSRF ...
- 【Leetcode】【Easy】Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Have you ...
- Angular 5.x 学习笔记(1) - 模板语法
Angular 5.x Template Syntax Learn Note Angular 5.x 模板语法学习笔记 标签(空格分隔): Angular Note on github.com 上手 ...
- Selenium入门21 Select操作
select元素有单独的类:from selenium.webdriver.support.ui import Select 界面上选出select元素后,Select(select)进行类型转换就可 ...
- 「C基础」位运算
0. 原码.补码.反码 初学者只做了解即可 见 张子秋的博客 无论正负数,在内存中存储的都是补码 正数:反码 == 原码 == 补码 负数:反码 == ~原码 补码 == 反码+1 1. & ...
- 【LOJ6060】「2017 山东一轮集训 Day1 / SDWC2018 Day1」Set(线性基)
点此看题面 大致题意: 让你把\(n\)个数分成两部分,使得在两部分异或和之和最大的前提下,两个异或和中较小的那个尽量小.输出最优的较小异或和. 线性基 关于线性基,可以看一下这篇博客:线性基入门. ...
- 【牛客挑战赛30D】小A的昆特牌(组合问题抽象到二维平面)
点此看题面 大致题意: 有\(S\)张无编号的牌,可以将任意张牌锻造成\(n\)种步兵或\(m\)种弩兵中的一种,求最后步兵数量大于等于\(l\)小于等于\(r\)的方案数. 暴力式子 首先我们来考虑 ...