Using mysql 5.6.19 on an ubuntu box, installed with sudo apt-get install and I am missing a few tables (got an alert from Workbench when trying to use the performance reports).
These are the tables that I do have in the performance_schema:
+----------------------------------------------+
| Tables_in_performance_schema |
+----------------------------------------------+
| cond_instances |
| events_waits_current |
| events_waits_history |
| events_waits_history_long |
| events_waits_summary_by_instance |
| events_waits_summary_by_thread_by_event_name |
| events_waits_summary_global_by_event_name |
| file_instances |
| file_summary_by_event_name |
| file_summary_by_instance |
| mutex_instances |
| performance_timers |
| rwlock_instances |
| session_connect_attrs |
| setup_consumers |
| setup_instruments |
| setup_timers |
| threads |
+----------------------------------------------+
From checking the docs I see that I am missing the following tables:
performance_schema.events_statements_current
performance_schema.events_statements_history
performance_schema.events_statements_history_long
performance_schema.events_stages_current
performance_schema.events_stages_history
performance_schema.events_stages_history_long
This is the output from show engines:
mysql> show engines;
...
*************************** 8. row ***************************
Engine: PERFORMANCE_SCHEMA
Support: YES
Comment: Performance Schema
Transactions: NO
XA: NO
Savepoints: NO
...
Can someone please post the show create table statements so I can create them? and if you notice another table that Im missing I would very much appreciate the show create table for that as well
The tables you have are from MySQL 5.5, the new tables in 5.6 are missing.
Please run mysql_upgrade.
Related
I'm trying to add a column to a specific table. Every time I run the migration up or down a SLEEP command pops up and blocks everything. Much like many other people who have run into this problem, I kill the blocking process and everything works as expected.
Ex:MySql alter table hangs
I've tried running the migration against a different table and have no issues. Seems to be something specific with this particular table.
Where or what should I be looking for? Why would this issue occur so consistently?
Thanks.
mysql> show processlist;
+-----+------+-----------------+--------+---------+------+---------------------------------+----------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+--------+---------+------+---------------------------------+----------------------------------------------+
| 351 | root | localhost:54691 | database | Sleep | 25 | | NULL |
| 352 | root | localhost:54692 | NULL | Sleep | 54 | | NULL |
| 377 | root | localhost | database | Query | 0 | starting | show processlist |
| 381 | root | localhost:54858 | database | Query | 5 | Waiting for table metadata lock | ALTER TABLE company ADD COLUMN active |
| 382 | root | localhost:54860 | database | Sleep | 5 | | NULL |
+-----+------+-----------------+--------+---------+------+---------------------------------+----------------------------------------------+
5 rows in set (0.00 sec)
The offending process in this case was 382.
The answers to many other similar posts say to kill the SLEEP process and then "debug". My problem was related to a circular import issue in Python, not related to MySQL.
I am using Server version: 5.6.27-log MySQL Community Server (GPL) and I have a problem with a table.
I tried to update some fields with a GUI software, but when I came back to the command line, the lines I tried to update where not updated.
I tried to see if the table was locked using SHOW OPEN TABLES as stated in various other questions. But my table does not appear to be locked:
+--------------------+-------------------------------------------------+--------+-------------+
| Database | Table | In_use | Name_locked |
+--------------------+-------------------------------------------------+--------+-------------+
| arcdev | SCHEDULED_COMMAND | 0 | 0 |
And as soon as I try to make an update like:
UPDATE SCHEDULED_COMMAND SET field = 1;
The server just keeps loading and nothing happen. I tried on other tables and everything worked just fine.
I also tried some DELETE requests and even a DROP TABLE and nothing work so far...
What am I missing?
Thank you for your precious help!
EDIT: Here is the result of the SHOW PROCESSLIST command while a request is hanging:
+--------+----------+---------------------------------------+-----------+---------+------+----------+-------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+--------+----------+---------------------------------------+-----------+---------+------+----------+-------------------------------+
| 282588 | rdsadmin | localhost:17966 | mysql | Sleep | 2 | | NULL |
| 534575 | arc | XXXXXX:49376 | arcdev | Sleep | 17 | | NULL |
| 534579 | arc | XXXXXX:49443 | arcdev | Query | 0 | init | SHOW PROCESSLIST |
| 534659 | arc | XXXXXX:49836 | arcdev | Query | 14 | updating | DELETE FROM SCHEDULED_COMMAND |
+--------+----------+---------------------------------------+-----------+---------+------+----------+-------------------------------+
In my MySQL 5.6.27 default installation the 'events_statements_summary_by_digest' table is missing in the 'performance_schema' database.
In fact, I think more tables are missing. Did I something wrong during the installation? How can I fix this?
use performance_schema;
show tables;
+----------------------------------------------+
| Tables_in_performance_schema |
+----------------------------------------------+
| cond_instances |
| events_waits_current |
| events_waits_history |
| events_waits_history_long |
| events_waits_summary_by_instance |
| events_waits_summary_by_thread_by_event_name |
| events_waits_summary_global_by_event_name |
| file_instances |
| file_summary_by_event_name |
| file_summary_by_instance |
| mutex_instances |
| performance_timers |
| rwlock_instances |
| setup_consumers |
| setup_instruments |
| setup_timers |
| threads |
+----------------------------------------------+
17 rows in set (0.00 sec)
The changelog for 5.6.9 says
"If you upgrade to this release of MySQL from an earlier version, you must run mysql_upgrade (and restart the server) to incorporate this change into the performance_schema database. (Bug #14075527)"
events_statements_summary_by_digest was added in 5.6.5.
I have installed MariaDB on my Debian but Archive Engine is missing.
Is there any way how to install Archive Engine?
I haven't file ha_archive in my /usr/lib/mysql/plugin directory
Try to install plugin using SQL shell.
MariaDB> INSTALL PLUGIN archive SONAME 'ha_archive.so';
Show Plugins
MariaDB> show engines \G
EDIT:
I have installed mariadb-10.x on ubuntu and ARCHIVE is by default enabled.
MariaDB> show engines \G
*************************** 7. row ***************************
Engine: ARCHIVE
Support: YES
Comment: Archive storage engine
Transactions: NO
XA: NO
Savepoints: NO
I fixed this by entering the following command in MariaDB by logging as a root user -
MariaDB [(none)]> INSTALL SONAME 'ha_archive';
Query OK, 0 rows affected (0.33 sec)
Check if it is installed -
MariaDB [(none)]> SHOW ENGINES;
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)
I have MySQL 5.6.19 community server running on my Ubuntu 14.04. Lately I have been trying to monitor MySQL server using performance_schema. Previously I used to do this by running SHOW FULL PROCESSLIST query every 5 second using a cronjob.
I configured performance_schema.setup_consumers table as follows.
mysql> use performance_schema;
mysql> select * from setup_consumers;
+--------------------------------+---------+
| NAME | ENABLED |
+--------------------------------+---------+
| events_stages_current | NO |
| events_stages_history | NO |
| events_stages_history_long | NO |
| events_statements_current | YES |
| events_statements_history | NO |
| events_statements_history_long | NO |
| events_waits_current | NO |
| events_waits_history | NO |
| events_waits_history_long | NO |
| global_instrumentation | YES |
| thread_instrumentation | YES |
| statements_digest | YES |
+--------------------------------+---------+
By default the events_statements_history is not enabled. I enabled it as follows.
mysql> update setup_consumers set enabled="YES" where name="events_statements_history";
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from setup_consumers;
+--------------------------------+---------+
| NAME | ENABLED |
+--------------------------------+---------+
| events_stages_current | NO |
| events_stages_history | NO |
| events_stages_history_long | NO |
| events_statements_current | YES |
| events_statements_history | YES |
| events_statements_history_long | NO |
| events_waits_current | NO |
| events_waits_history | NO |
| events_waits_history_long | NO |
| global_instrumentation | YES |
| thread_instrumentation | YES |
| statements_digest | YES |
+--------------------------------+---------+
Now enabled, the events_statements_history table should now be able to capture queries but somehow it is not. Following is the result.
mysql> select count(sql_text) from events_statements_history;
+-----------------+
| count(sql_text) |
+-----------------+
| 0 |
+-----------------+
I do not understand as to why it is not logging in any queries?
The performance schema records data when three conditions are met:
The running thread is instrumented
The instrument currently executed is enabled
The consumers for the data to record are enabled
Threads
By default, every thread (1) is instrumented.
To check if threads are instrumented:
select THREAD_ID, NAME, PROCESSLIST_ID, PROCESSLIST_USER, PROCESSLIST_HOST, INSTRUMENTED from threads;
To change which threads are instrumented by default, use table setup_actors.
Instruments
By default, instruments for statements (aka, queries), are enabled (2).
To see which queries are not instrumented:
select * from setup_instruments where name like "statement/%" and enabled='NO';
To instrument all queries:
update setup_instruments set enabled="YES" where name like "statement/%";
Consumers
By default, only a few consumers are instrumented (3).
To see which consumers are instrumented, or to change this, use select / update on table setup_consumers.
This part seems fine per the question, so check part (1) and (2).
As a side-note, if there is nothing inside the setup_% tables then you might need to enable the performance schema,
https://dev.mysql.com/doc/refman/5.5/en/performance-schema-quick-start.html