Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR 1146 (42S02): Table 'mysql.TABLE_STATISTICS' doesn't exist #47

Closed
lslxdx opened this issue Mar 2, 2017 · 4 comments
Closed

ERROR 1146 (42S02): Table 'mysql.TABLE_STATISTICS' doesn't exist #47

lslxdx opened this issue Mar 2, 2017 · 4 comments

Comments

@lslxdx
Copy link

lslxdx commented Mar 2, 2017

我编译安装了AliSQL 5.6.32 (2017 02 14), 但是在使用table/index statistics特性的时候报错了。

以下是复现过程:

# /opt/alisql/bin/mysql --version
/opt/alisql/bin/mysql  Ver 14.14 Distrib 5.6.32, for Linux (x86_64) using  EditLine wrapper

# /opt/alisql/bin/mysql -uroot -P 3360

mysql> use mysql;
mysql> SELECT * FROM TABLE_STATISTICS;
ERROR 1146 (42S02): Table 'mysql.TABLE_STATISTICS' doesn't exist

请大神拨云见日...

@xpchild
Copy link
Contributor

xpchild commented Mar 2, 2017

TABLE_STATISTICS表在information_schema数据库下。

@lslxdx
Copy link
Author

lslxdx commented Mar 2, 2017

information_schema数据库下确实存在TABLE_STATISTICS表。

我以为select * from TABLE_STATISTICS;是AliSQL特有的,是MySQL/MariaDB所不支持的特性……
但是我发现在MariaDB里也支持:

➜  ~ mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.1.21-MariaDB Homebrew

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [information_schema]> select * from TABLE_STATISTICS;
Empty set (0.00 sec)

MariaDB [information_schema]> select version();
+-----------------+
| version()       |
+-----------------+
| 10.1.21-MariaDB |
+-----------------+
1 row in set (0.00 sec)

是不是我对AliSQL的table/index statistics特性的打开方式错了,应该怎么做?

@fungo
Copy link
Collaborator

fungo commented Mar 13, 2017

请参考release note: table/index statistics,有2个参数开关需要打开 rds_tablestat rds_indexstat

@lslxdx
Copy link
Author

lslxdx commented Mar 14, 2017

是的 确实有2个参数开关rds_tablestatrds_indexstat

P.S 我发现10.1.21也支持table/index statistics了 :-)

MariaDB [(none)]> select version();
+-----------------+
| version()       |
+-----------------+
| 10.1.21-MariaDB |
+-----------------+

MariaDB [(none)]> use information_schema;

MariaDB [information_schema]> SELECT * FROM TABLE_STATISTICS;
Empty set (0.00 sec)

MariaDB [information_schema]> SELECT * FROM INDEX_STATISTICS;
Empty set (0.00 sec)

@xpchild xpchild closed this as completed Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants