mysql linux服务器安装教程

安装教程

https://blog.csdn.net/qq_37598011/article/details/93489404

cdh集群链接mysql 命令

grant all on scm.* TO scm@localhost IDENTIFIED BY ‘scm_password’;
create database amon DEFAULT CHARACTER SET utf8;
grant all on amon.* TO ‘amon’@‘%’ IDENTIFIED BY ‘amon_password’;
grant all on amon.* TO amon@localhost IDENTIFIED BY ‘amon_password’;
create database smon DEFAULT CHARACTER SET utf8;
grant all on smon.* TO ‘smon’@‘%’ IDENTIFIED BY ‘smon_password’;
create database rman DEFAULT CHARACTER SET utf8;
grant all on rman.* TO ‘rman’@‘%’ IDENTIFIED BY ‘rman_password’;
create database hmon DEFAULT CHARACTER SET utf8;
grant all on hmon.* TO ‘hmon’@‘%’ IDENTIFIED BY ‘hmon_password’;
create database hive DEFAULT CHARACTER SET utf8;
grant all on hive.* TO ‘hive’@‘%’ IDENTIFIED BY ‘hive_password’;
grant all on smon.* TO smon@localhost IDENTIFIED BY ‘smon_password’;
grant all on rman.* TO rman@localhost IDENTIFIED BY ‘rman_password’;
grant all on hmon.* TO hmon@localhost IDENTIFIED BY ‘hmon_password’;
grant all on hive.* TO hive@localhost IDENTIFIED BY ‘hive_password’;

开启binlog日志方式

1、查看binlog状态语句
  • show variables like ‘%log_bin%’;
2、查看binlog日志格式
  • show variables like ‘%binlog_format%’;
3、创建目录和设置权限组
mkdir /usr/local/mysql/log-bin
chown -R mysql:mysql /usr/local/mysql
chmod -R 755 /usr/local/mysql

4、修改MySQL配置(my.cnf)
vi /etc/my.cnf
# server-id表示单个结点的id,这里由于只有一个结点,所以可以把id随机指定为一个数,这里将id设置成1。若集群中有多个结点,则id不能相同
server-id=1
# log-bin日志文件的名字为mysql-bin,以及其存储路径
log-bin=/usr/local/mysql/log-bin/mysql-bin
#设置格式为ROW
binlog_format=ROW
5、停止mysql
  • service mysql stop
6、重启mysql
  • service mysql start
7、跳过输入密码直接进入
vim /etc/my.cnf
skip-grant-tables
8、修改密码
update user set authentication_string=password("chrd5hdhxt!") where user="root";
flush privileges;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值