ホームページ データベース mysql チュートリアル [mysqldumpslow 出错] Died at /usr/local/mysql/bin/mysqldumps

[mysqldumpslow 出错] Died at /usr/local/mysql/bin/mysqldumps

Jun 07, 2016 pm 04:25 PM
usr エラー

[mysqldumpslow 报错] Died at /usr/local/mysql/bin/mysqldumpslow line 161, chunk 236. mysqldumpslow报错: Died at /usr/local/mysql/bin/mysqldumpslow line 161, chunk 236. 总结:是因为top数目太多了,mysqldumpslow遍历不过来的缘故。 /usr/local/m

[mysqldumpslow 报错] Died at /usr/local/mysql/bin/mysqldumpslow line 161, chunk 236.

mysqldumpslow报错:Died at /usr/local/mysql/bin/mysqldumpslow line 161, chunk 236.

总结:是因为top数目太多了,mysqldumpslow遍历不过来的缘故。

/usr/local/mysql/bin/mysqldumpslow -s -t 15 /root/db01-102-slow.log 


1,把r去掉试试,还是报错,参数不识别。

[root@slave ]# /usr/local/mysql/bin/mysqldumpslow -s -t 15 /root/db01-102-slow.log 

Reading mysql slow query log from 15 /root/db01-102-slow.log
Can't open 15: 没有那个文件或目录 at /usr/local/mysql/bin/mysqldumpslow line 91.
Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts
  select count(*)
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id

Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [dubbo]@2hosts
  select count(*) from user_info
  LEFT JOIN system_region a
  ON province_id =a.region_id
  LEFT JOIN system_region b
  ON city_id = b.region_id
  LEFT JOIN system_region c
  ON district_id = c.region_id

Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [dubbo]@2hosts
  select 
  coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,
  coupon.code,  coupon_lot.coupon_type, coupon.state,
  coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel, 
  coupon_lot.is_reusable, coupon_lot.start_datetime,
  coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,
  coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,
  coupon_lot.pdt_code,brand.brand_name,product_category.category_name
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id
  group by coupon_lot.coupon_lot_id
  order by coupon_lot.create_datetime DESC
  limit N,N

Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [dubbo]@2hosts
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  limit N,N

Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost
  select sleep(N)

Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [dubbo]@[xx]
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  , oi.order_sn 
  limit N,N

Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [dubbo]@2hosts
  select
  user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone, 
  birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime, 
  active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel, 
  tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key, 
  verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question, 
  verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel
  from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')
ログイン後にコピー

2,查看下mysqldumpslow 使用参数,-s后面需要带参数的,看了西夏at比较合适

[root@db-master-2 ~]# /usr/local/mysql/bin/mysqldumpslow  --help
Usage: mysqldumpslow [ OPTS... ] [ LOGS... ]

Parse and summarize the MySQL slow query log. Options are

  --verbose    verbose
  --debug      debug
  --help       write this text to standard output

  -v           verbose
  -d           debug
  -s ORDER     what to sort by (al, at, ar, c, l, r, t), 'at' is default
                al: average lock time
                ar: average rows sent
                at: average query time
                 c: count
                 l: lock time
                 r: rows sent
                 t: query time  
  -r           reverse the sort order (largest last instead of first)
  -t NUM       just show the top n queries
  -a           don't abstract all numbers to N and strings to 'S'
  -n NUM       abstract numbers with at least n digits within names
  -g PATTERN   grep: only consider stmts that include this string
  -h HOSTNAME  hostname of db server for *-slow.log filename (can be wildcard),
               default is '*', i.e. match all
  -i NAME      name of server instance (if using mysql.server startup script)
  -l           don't subtract lock time from total time
ログイン後にコピー


3,在mysqldumpslow的-s后面加入 at参数试试:  [root@slave ]# /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log 

[root@db-master-2 ~]# /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log 
Reading mysql slow query log from /root/db01-102-slow.log
Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [dubbo]@2hosts
  select 
  coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,
  coupon.code,  coupon_lot.coupon_type, coupon.state,
  coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel, 
  coupon_lot.is_reusable, coupon_lot.start_datetime,
  coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,
  coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,
  coupon_lot.pdt_code,brand.brand_name,product_category.category_name
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id
  group by coupon_lot.coupon_lot_id
  order by coupon_lot.create_datetime DESC
  limit N,N

Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts
  select count(*)
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id

Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [dubbo]@2hosts
  select
  user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone, 
  birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime, 
  active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel, 
  tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key, 
  verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question, 
  verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel
  from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')

Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [dubbo]@2hosts
  select count(*) from user_info
  LEFT JOIN system_region a
  ON province_id =a.region_id
  LEFT JOIN system_region b
  ON city_id = b.region_id
  LEFT JOIN system_region c
  ON district_id = c.region_id

Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [dubbo]@[10.10.3.8]
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  , oi.order_sn 
  limit N,N

Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [dubbo]@2hosts
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  limit N,N

Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost
  select sleep(N)

Died at /usr/local/mysql/bin/mysqldumpslow line 161,  chunk 236.
ログイン後にコピー
看到后面还是报错:Died at /usr/local/mysql/bin/mysqldumpslow line 161, chunk 236.

4,去看看/usr/local/mysql/bin/mysqldumpslow的第161行左右,到底是在操作什么脚本。

156 my @sorted = sort { $stmt{$b}->{$opt{s}}  $stmt{$a}->{$opt{s}} } keys %stmt;
157 @sorted = @sorted[0 .. $opt{t}-1] if $opt{t};
158 @sorted = reverse @sorted         if $opt{r};
159 
160 foreach (@sorted) {
161     my $v = $stmt{$_} || die;
162     my ($c, $t,$at, $l,$al, $r,$ar) = @{ $v }{qw(c t at l al r ar)};
163     my @users = keys %{$v->{users}};
164     my $user  = (@users==1) ? $users[0] : sprintf "%dusers",scalar @users;
165     my @hosts = keys %{$v->{hosts}};
166     my $host  = (@hosts==1) ? $hosts[0] : sprintf "%dhosts",scalar @hosts;
167     printf "Count: %d  Time=%.2fs (%ds)  Lock=%.2fs (%ds)  Rows=%.1f (%d), $user\@$host\n%s\n\n",
168             $c, $at,$t, $al,$l, $ar,$r, $_;
169 }
170 
171 sub usage {
172     my $str= shift;
ログイン後にコピー
看到主要是foreach (@sorted)遍历函数,也就是遍历到chunk 236的时候就died结束了,没有办法往下继续foreach了。因为以前写过代码,知道报错所在的这一行

 my $v = $stmt{$_} || die;
ログイン後にコピー
是遍历第一句,那么肯定是赋值语句,报错Died,chunk 236肯定是已经遍历到末尾没有数据了,看这个函数没有判断传入的参数是否为null的逻辑,所以当文件数据已经遍历完,但是命令还没有结束,所以继续遍历,遍历null的时候报错,所以进程中止了,解决办法就是做个限制不要遍历超过原始数据的字符串长度。那么我们再来看执行的命令:

 /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log 有 -t 15这一句,那么就是要显示出前15个记录,那么如果我的slow.log统计出来只有12个不到15个,而这里有继续遍历到15的话,那进程肯定会Died。


所以这里有2个解决方法:

1 修改/usr/local/mysql/bin/mysqldumpslow里面的源代码,加null判断。

这个过程有些复杂,暂时略过吧,期待后续空了再研究。


2 修改命令  /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log ,把-t 15修改成-t 10或者-t 5试试。

试了好几次,发现临界点在-t 7上面,如下:

[root@slave~]# /usr/local/mysql/bin/mysqldumpslow -s at -t 8 /root/db01-102-slow.log 
Reading mysql slow query log from /root/db01-102-slow.log
Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [dubbo]@2hosts
  select 
  coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,
  coupon.code,  coupon_lot.coupon_type, coupon.state,
  coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel, 
  coupon_lot.is_reusable, coupon_lot.start_datetime,
  coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,
  coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,
  coupon_lot.pdt_code,brand.brand_name,product_category.category_name
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id
  group by coupon_lot.coupon_lot_id
  order by coupon_lot.create_datetime DESC
  limit N,N

Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts
  select count(*)
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id

Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [dubbo]@2hosts
  select
  user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone, 
  birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime, 
  active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel, 
  tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key, 
  verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question, 
  verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel
  from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')

Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [xx]@2hosts
  select count(*) from user_info
  LEFT JOIN system_region a
  ON province_id =a.region_id
  LEFT JOIN system_region b
  ON city_id = b.region_id
  LEFT JOIN system_region c
  ON district_id = c.region_id

Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [xx]@[xxx]
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  , oi.order_sn 
  limit N,N

Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [xx]@2hosts
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  limit N,N

Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost
  select sleep(N)

Died at /usr/local/mysql/bin/mysqldumpslow line 161,  chunk 236.

-- 临界点 -t 7
[root@db-master-2 ~]# /usr/local/mysql/bin/mysqldumpslow -s at -t 7 /root/db01-102-slow.log 

Reading mysql slow query log from /root/db01-102-slow.log
Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [xx]@2hosts
  select 
  coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,
  coupon.code,  coupon_lot.coupon_type, coupon.state,
  coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel, 
  coupon_lot.is_reusable, coupon_lot.start_datetime,
  coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,
  coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,
  coupon_lot.pdt_code,brand.brand_name,product_category.category_name
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id
  group by coupon_lot.coupon_lot_id
  order by coupon_lot.create_datetime DESC
  limit N,N

Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts
  select count(*)
  from coupon_lot
  left join coupon 
  on coupon.coupon_lot_id = coupon_lot.coupon_lot_id
  LEFT JOIN brand
  ON brand.brand_id=coupon_lot.brand_id
  LEFT JOIN product_category
  on product_category.category_id=coupon_lot.category_id

Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [xx]@2hosts
  select
  user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone, 
  birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime, 
  active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel, 
  tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key, 
  verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question, 
  verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel
  from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')

Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [xx]@2hosts
  select count(*) from user_info
  LEFT JOIN system_region a
  ON province_id =a.region_id
  LEFT JOIN system_region b
  ON city_id = b.region_id
  LEFT JOIN system_region c
  ON district_id = c.region_id

Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [dubbo]@[xxx]
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  , oi.order_sn 
  limit N,N

Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [dubbo]@2hosts
  select 
  return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,
  add_time , return_type, 
  return_pay, ui.usename as userName, return_consignee, return_goods_count ,
  return_total_fee, total_paid, 
  return_desc, return_order_status,  return_pay_status ,
  return_shipping_status, order_return.lock_operator, order_return.return_invoice_no
  from order_return  LEFT JOIN   order_info oi
  on order_return.relating_order_sn = oi.order_sn 
  left join user_info ui on oi.user_id = ui.user_id
  left join order_payment on order_payment.order_sn = oi.order_sn
  order by order_return.add_time DESC
  limit N,N

Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost
  select sleep(N)

[root@db-master-2 ~]# 
ログイン後にコピー

最终总结:
mysqldumpslow报错:Died at /usr/local/mysql/bin/mysqldumpslow line 161, chunk 236. 是因为top数目太多了,mysqldumpslow遍历不过来的缘故。

このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

MySQLでインデックスを使用するよりも、フルテーブルスキャンがいつ速くなるのでしょうか? MySQLでインデックスを使用するよりも、フルテーブルスキャンがいつ速くなるのでしょうか? Apr 09, 2025 am 12:05 AM

完全なテーブルスキャンは、MySQLでインデックスを使用するよりも速い場合があります。特定のケースには以下が含まれます。1)データボリュームは小さい。 2)クエリが大量のデータを返すとき。 3)インデックス列が高度に選択的でない場合。 4)複雑なクエリの場合。クエリプランを分析し、インデックスを最適化し、オーバーインデックスを回避し、テーブルを定期的にメンテナンスすることにより、実際のアプリケーションで最良の選択をすることができます。

INNODBフルテキスト検索機能を説明します。 INNODBフルテキスト検索機能を説明します。 Apr 02, 2025 pm 06:09 PM

INNODBのフルテキスト検索機能は非常に強力であり、データベースクエリの効率と大量のテキストデータを処理する能力を大幅に改善できます。 1)INNODBは、倒立インデックスを介してフルテキスト検索を実装し、基本的および高度な検索クエリをサポートします。 2)一致を使用してキーワードを使用して、ブールモードとフレーズ検索を検索、サポートします。 3)最適化方法には、単語セグメンテーションテクノロジーの使用、インデックスの定期的な再構築、およびパフォーマンスと精度を改善するためのキャッシュサイズの調整が含まれます。

Windows 7にMySQLをインストールできますか? Windows 7にMySQLをインストールできますか? Apr 08, 2025 pm 03:21 PM

はい、MySQLはWindows 7にインストールできます。MicrosoftはWindows 7のサポートを停止しましたが、MySQLは引き続き互換性があります。ただし、インストールプロセス中に次のポイントに注意する必要があります。WindowsのMySQLインストーラーをダウンロードしてください。 MySQL(コミュニティまたはエンタープライズ)の適切なバージョンを選択します。インストールプロセス中に適切なインストールディレクトリと文字セットを選択します。ルートユーザーパスワードを設定し、適切に保ちます。テストのためにデータベースに接続します。 Windows 7の互換性とセキュリティの問題に注意してください。サポートされているオペレーティングシステムにアップグレードすることをお勧めします。

MySQL:簡単な学習のためのシンプルな概念 MySQL:簡単な学習のためのシンプルな概念 Apr 10, 2025 am 09:29 AM

MySQLは、オープンソースのリレーショナルデータベース管理システムです。 1)データベースとテーブルの作成:createdatabaseおよびcreateTableコマンドを使用します。 2)基本操作:挿入、更新、削除、選択。 3)高度な操作:参加、サブクエリ、トランザクション処理。 4)デバッグスキル:構文、データ型、およびアクセス許可を確認します。 5)最適化の提案:インデックスを使用し、選択*を避け、トランザクションを使用します。

INNODBのクラスターインデックスと非クラスターインデックス(セカンダリインデックス)の違い。 INNODBのクラスターインデックスと非クラスターインデックス(セカンダリインデックス)の違い。 Apr 02, 2025 pm 06:25 PM

クラスター化されたインデックスと非クラスター化されたインデックスの違いは次のとおりです。1。クラスター化されたインデックスは、インデックス構造にデータを保存します。これは、プライマリキーと範囲でクエリするのに適しています。 2.非クラスター化されたインデックスストアは、インデックスキー値とデータの行へのポインターであり、非プリマリーキー列クエリに適しています。

mysqlとmariadbは共存できますか mysqlとmariadbは共存できますか Apr 08, 2025 pm 02:27 PM

MySQLとMariaDBは共存できますが、注意して構成する必要があります。重要なのは、さまざまなポート番号とデータディレクトリを各データベースに割り当て、メモリ割り当てやキャッシュサイズなどのパラメーターを調整することです。接続プーリング、アプリケーションの構成、およびバージョンの違いも考慮する必要があり、落とし穴を避けるために慎重にテストして計画する必要があります。 2つのデータベースを同時に実行すると、リソースが制限されている状況でパフォーマンスの問題を引き起こす可能性があります。

MySQLユーザーとデータベースの関係 MySQLユーザーとデータベースの関係 Apr 08, 2025 pm 07:15 PM

MySQLデータベースでは、ユーザーとデータベースの関係は、アクセス許可と表によって定義されます。ユーザーには、データベースにアクセスするためのユーザー名とパスワードがあります。許可は助成金コマンドを通じて付与され、テーブルはCreate Tableコマンドによって作成されます。ユーザーとデータベースの関係を確立するには、データベースを作成し、ユーザーを作成してから許可を付与する必要があります。

さまざまなタイプのMySQLインデックス(Bツリー、ハッシュ、フルテキスト、空間)を説明します。 さまざまなタイプのMySQLインデックス(Bツリー、ハッシュ、フルテキスト、空間)を説明します。 Apr 02, 2025 pm 07:05 PM

MySQLは、Bツリー、ハッシュ、フルテキスト、および空間の4つのインデックスタイプをサポートしています。 1.B-Treeインデックスは、等しい値検索、範囲クエリ、ソートに適しています。 2。ハッシュインデックスは、等しい値検索に適していますが、範囲のクエリとソートをサポートしていません。 3.フルテキストインデックスは、フルテキスト検索に使用され、大量のテキストデータの処理に適しています。 4.空間インデックスは、地理空間データクエリに使用され、GISアプリケーションに適しています。

See all articles