Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

& # 039 _ mysql.columnkeeper stats _ blank _ 039; doesn't exist and Table & # 039 _ mysql.indexkeeper stats _ blank _ blank 039; doesn'

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Modify the field type in the production library MariabDB and prompt the following error:

Table 'mysql.column_stats' doesn't exist

Table 'mysql.index_stats' doesn't exist

The MariaDB version is as follows:

MariaDB [mysql] > select @ @ version

+-+

| | @ @ version |

+-+

| | 10.0.12-MariaDB-log |

+-+

Connect to the mysql database checklist:

MariaDB [mysql] > show tables

+-+

| | Tables_in_mysql |

+-+

| | columns_priv |

| | db |

| | event |

| | func |

| | general_log |

| | gtid_slave_pos |

| | help_category |

| | help_keyword |

| | help_relation |

| | help_topic |

| | host |

| | innodb_index_stats |

| | innodb_table_stats |

| | inventory |

| | ndb_binlog_index |

| | plugin |

| | proc |

| | procs_priv |

| | proxies_priv |

| | servers |

| | slave_master_info |

| | slave_relay_log_info |

| | slave_worker_info |

| | slow_log |

| | tables_priv |

| | time_zone |

| | time_zone_leap_second |

| | time_zone_name |

| | time_zone_transition |

| | time_zone_transition_type |

| | user |

+-+

Check and find that several tables that indicate errors are missing, column_stats, index_stats, table_stats

Solution:

Create the above table in the main library:

CREATE TABLE IF NOT EXISTS `column_ stats` (

`db_ name` varchar (64) NOT NULL COMMENT 'Database the table is in.'

`table_ name` varchar (64) NOT NULL COMMENT 'Table name.'

`column_ name` varchar (64) NOT NULL COMMENT 'Name of the column.'

`min_ value`varchar (255) DEFAULT NULL COMMENT 'Minimum value in the table (in text form).

`max_ value`varchar (255) NOT NULL COMMENT 'Maximum value in the table (in text form).

`nulls_ ratio`decimal (122.4) DEFAULT NULL COMMENT 'Fraction of NULL values (0-no NULLs, 0.5-half values are NULLs, 1-all values are NULLs).

`avg_ in bytes 4) DEFAULT NULL COMMENT 'Average length of column value, in bytes. Counted as if one ran SELECT AVG (LENGTH (col)) .This doesn''t count NULL bytes, assumes endspace removal for CHAR (n), etc.'

`avg_ classency` decimal (12je 4) DEFAULT NULL COMMENT 'Average number of records with the same value'

`hist_ size`tinyint (3) unsigned DEFAULT NULL COMMENT 'Histogram size in bytes, from 0-255.'

`hist_ type` enum ('SINGLE_PREC_HB','DOUBLE_PREC_HB') DEFAULT NULL COMMENT' Histogram type. See the histogram_type system variable.'

`histogram` varbinary (255) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8

CREATE TABLE IF NOT EXISTS `index_ stats` (

`db_ name` varchar (64) NOT NULL COMMENT 'Database the table is in.'

`table_ name` varchar (64) NOT NULL COMMENT 'Table name'

`index_ name` varchar (64) NOT NULL COMMENT 'Name of the index'

`prefix_ arity` int (10) unsigned NOT NULL COMMENT 'Index prefix length. 1 for the first keypart, 2 for the first two, and so on. InnoDB''s extended keys are supported.'

`avg_ classency` decimal (12je 4) DEFAULT NULL COMMENT 'Average number of records one will find for given values of (keypart1, keypart2,..), provided the values will be found in the table.'

) ENGINE=InnoDB DEFAULT CHARSET=utf8

CREATE TABLE IF NOT EXISTS `table_ stats` (

`db_ name`varchar (64) NOT NULL COMMENT 'Database the table is in.'

`table_ name` varchar (64) NOT NULL COMMENT 'Table name.'

`cardinality` bigint (21) DEFAULT NULL COMMENT 'Number of records in the table.'

) ENGINE=InnoDB DEFAULT CHARSET=utf8

ALTER TABLE `column_ stats`

ADD PRIMARY KEY (`db_ name`, `table_ name`, `column_ name`)

ALTER TABLE `index_ stats`

ADD PRIMARY KEY (`db_ name`, `table_ name`, `index_ name`, `prefix_ arity`)

ALTER TABLE `table_ stats`

ADD PRIMARY KEY (`db_ name`, `table_ name`)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report