随笔分类 -  Mysql

摘要:mysql> select user,plugin,host from user where user ='root';+ + + +| user | plugin | host |+ + + +| root | caching_sha2_password | % |+ + + + mysql> a 阅读全文
posted @ 2022-11-03 08:37 beawh 阅读(51) 评论(0) 推荐(0) 编辑
摘要:SELECT * FROM information_schema.columns WHERE column_name='BYTES_' ; SELECT * FROM information_schema.columns WHERE data_type like '%BLOB' ; 阅读全文
posted @ 2022-07-06 17:39 beawh 阅读(40) 评论(0) 推荐(0) 编辑
摘要:selecttable_schema as '数据库',table_name as '表名',table_rows as '记录数',truncate(data_length/1024/1024, 2) as '数据容量(MB)',truncate(index_length/1024/1024, 2 阅读全文
posted @ 2022-07-05 14:42 beawh 阅读(31) 评论(0) 推荐(0) 编辑
摘要:C:\Windows\system32>mysql -uroot -p'ZFB^2j899Wn'mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 1045 (28000): Ac 阅读全文
posted @ 2022-05-04 15:48 beawh 阅读(349) 评论(0) 推荐(0) 编辑
摘要:1.导出指定表的数据 (包含 drop table ,create table insert into 及表结构和数据) mysqldump -uiXmpop -p -h -P3306 iXpmmp --tables sys_setting >/home/soft/t1.sql 2.导出指定表的结构 阅读全文
posted @ 2022-04-26 14:28 beawh 阅读(3093) 评论(0) 推荐(0) 编辑
摘要:查看当前用户权限: show grants ; show grants for current_user() ; show grants for 'user'@'%' ; 建用户赋予权限: create user 'li4' identified by 'abc123' ; grant all pr 阅读全文
posted @ 2022-04-04 17:40 beawh 阅读(21) 评论(0) 推荐(0) 编辑
摘要:5.7中 innodb存储引擎: 如果采用系统表空间,表数据存储在ibdata1中,采用独立表空间则如下所示: emp1.frm # 存表结构 emp1.ibd #存表数据 5.7 中myisam存储引擎: student_myisam.frm #存表结构 student_myisam.MYD #存 阅读全文
posted @ 2022-04-04 14:30 beawh 阅读(19) 评论(0) 推荐(0) 编辑
摘要:配置文件my.cnf vim my.cnf #my.cnf [client] port = 3306 socket = /tmp/mysql3306.sock [mysql] prompt="\\u@\\h [\\d]>" #pager="less -i -n -S" #tee=/opt/mysql 阅读全文
posted @ 2022-03-19 21:50 beawh 阅读(78) 评论(0) 推荐(0) 编辑
摘要:硬件配置信息 检查项 操作命令 服务器名称 hostname 服务器型号 dmidecode |grep "Product Name" CPU cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 内存 cat /proc/meminfo 磁盘 阅读全文
posted @ 2022-03-19 00:03 beawh 阅读(820) 评论(0) 推荐(0) 编辑
摘要:mysqladmin extended-status(可以使用ext代替)。 加上参数-r(--relative),就可以看到各个指标的差值,配合参数-i(--sleep)就可以指定刷新的频率,那么就有如下命令: mysqladmin -uroot -pmysql123 ext -i 5 | awk 阅读全文
posted @ 2022-02-16 14:21 beawh 阅读(88) 评论(0) 推荐(0) 编辑
摘要:1、什么原因可能导致主从同步延时,怎么判断,怎么处理? 主从同步延时的原因:(1)从库的硬件配置没有主库好 (2)网络抖动导致IO线程复制延时(3)主库对没有索引的大表的列进行删除或者修改操作,主库上存在大事务怎么判断主从延时:(1)通过show slave status命令查看seconds_be 阅读全文
posted @ 2022-02-15 15:44 beawh 阅读(370) 评论(0) 推荐(0) 编辑
摘要:mysql> select * from tx1+ + + +| id | c1 | c2 |+ + + +| 1 | aaa | aaa2 || 2 | bbb2 | bbb2 || 3 | ccc5 | ccc2 || 4 | ddd | ddd4 || 8 | hhh | hhhh8 |+ + 阅读全文
posted @ 2022-02-14 14:55 beawh 阅读(293) 评论(0) 推荐(0) 编辑
摘要:MySQL8应该使用transaction_isolation,tx_isolation被弃用。 重新登录生效。 在RC隔离级别,在会话1窗口commit 的数据在会话2窗口可以执行查询到。 阅读全文
posted @ 2022-01-21 11:24 beawh 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-01-21 11:10 beawh 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-01-21 10:50 beawh 阅读(18) 评论(0) 推荐(0) 编辑
摘要:mysql> show variables like '%commit%'; + + + | Variable_name | Value | + + + | autocommit | OFF | | innodb_commit_concurrency | 0 | | innodb_flush_log 阅读全文
posted @ 2022-01-20 14:15 beawh 阅读(853) 评论(0) 推荐(1) 编辑
摘要:执行计划作用是如下: 表的读取顺序 数据读取操作的操作类型 哪些索引可以使用 哪些索引被实际使用 表之间的引用 每张表有多少行被优化器查询 1.1 id select查询的序列号,包含一组数字,表示查询中执行select子句或者操作表的顺序 id号分为三种情况: ​ 1、如果id相同,那么执行顺序从 阅读全文
posted @ 2022-01-10 15:08 beawh 阅读(34) 评论(0) 推荐(0) 编辑
摘要:information_schema 顾名思义就是一个信息库,是用来存储数据库的元数据。 mysql> show tables ;+ +| Tables_in_information_schema |+ +| CHARACTER_SETS || COLLATIONS || COLLATION_CHA 阅读全文
posted @ 2021-12-11 14:57 beawh 阅读(52) 评论(0) 推荐(0) 编辑
摘要:mysql> select table_schema, concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES group by table_schema; 查询指定库,指定表的大小: mysql> select co 阅读全文
posted @ 2021-12-10 17:34 beawh 阅读(122) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示