mysql--高级篇
来源:互联网 发布:工程造价用什么软件 编辑:程序博客网 时间:2024/05/17 23:52
一、配置文件:/etc/my.cnf
[client] //client配置标记
[mysqld] //server配置开始标记。之前是client的
- character_set_server=utf8 //字符集
- log-bin=/opt/mysql/binlog/mysql-bin //binlog位置
- binlog_format=ROW //binlog格式
- server-id=11
二、权限
- mysql权限表有4个:
- SELECT * FROM user where mysql.User =’user_abc’;
- select * from db where mysql.User =’user_abc’;
- select * from mysql.tables_priv;
- select * from mysql.columns_priv;
权限命令:
- show GRANTS for ‘user_abc’ //列出权限,一般是user表,db表的数据
- grant all privileges on database.* to user_abc@localhost identified by ‘passwd’;
- grant all privileges on . to ‘user_abc’@’%’ identified by ‘passwd’;
- grant all privileges on . to ‘user_abc’@’1.1.%.%’ identified by ‘passwd’;
- flush privileges; //权限立即生效
主从复制/binlog需要以下4个权限:
- REPLICATION CLIENT,REPLICATION SLAVE,SUPER,RELOAD
- SHOW master STATUS //binlog信息
- SHOW slave STATUS //master_host,master_port, master_user, binglog等信息
三、binlog命令
- show binary logs; //binlog文件列表
- show binlog events in ‘mysql-bin.000009’ //binlog详情
- show binlog events in ‘mysql-bin.000009’ from 1012
- mysqladmin -uroot -p123456 flush-logs //强制生产新的binlog文件
- mysqlbinlog查看binlog
- mysqlbinlog –base64-output=decode-rows -v –start-datetime=’2017-12-01 18:00:00’ –stop-datetime=’2017-12-01 19:00:00’ mysql-bin.000009
四、事务锁&负载
- SELECT * FROM information_schema.innodb_trx ;
- SELECT * FROM information_schema.innodb_locks;
- SELECT * FROM information_schema.innodb_lock_waits;
阅读全文
0 0
- mysql--高级篇
- MySQL高级
- MySQL高级
- MySQL高级
- mysql 高级
- MySQL高级
- Mysql高级
- mysql高级高级数据操作
- mysql高级渗透经验
- mysql 高级用法
- mysql高级开始[0]
- mysql高级之日志
- mysql高级之备份
- MYSQL之高级查询
- MySQL创建高级联结
- mysql高级语法
- mysql高级查询
- MySQL高级编程
- git 报这个错 fatal: refusing to merge unrelated histories
- Samba
- 建立一个node.js服务器(使用express搭建第一个Web环境)
- 自如网房源释放自动提醒爬虫
- 互联网支付系统整体架构详解
- mysql--高级篇
- 【嵌入式学习历程11】数据结构之二叉树
- 2017年12月5日 第三十三天次总结
- 李彦宏乌镇谈人工智能:百度会很快和雄安宣布一个大的智能城市计划
- 三份研究报告,聚焦 AI 的三大主要话题
- iptables
- systemd管理服务
- Javascript——If语句
- 2017年我国人工智能行业相关政策分析