Posts Tagged ‘MySQL’

DBT2: stmt ERROR: 1406 Data too long for column ‘out_w_city’ at row 1

Another issue with the DBT2 benchmarking suite. mysql reports SQL STMT: stmt ERROR: 1406 Data too long for column ‘out_w_city’ at row 1 Just edit the payment stored procedure and change; ?View Code MYSQLDECLARE out_w_city VARCHAR(10); To; ?View Code MYSQLDECLARE out_w_city VARCHAR(20);

[ERROR] Native table ‘performance_schema’.’table name’ has the wrong structure

After I upgraded an instance to MySQL 5.7 I noted the following errors in the log; 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_current’ has the wrong structure 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_history’ has the wrong structure 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_history_long’ has the wrong structure 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_summary_by_thread_by_event_name’ […]

Migrate users between MySQL Servers with pt-show-grants

If you use MySQL but don’t use Percona Toolkit you’re really missing a trick. It contains a whole host of useful tools including pt-show-grants which I use to migrate users between servers easily. ?View Code BASHpt-show-grants –host mysqlservername –user username –password secret | mysql -h localhost -u username -p If you want to filter out any […]

MySQL Cursor bug?

I came across this little funny with MySQL cursors today. This may be documented somewhere in the manual but I couldn’t find it. Thought I’d post it here for anyone else experiencing cursor issues with MySQL. First, a quick illustration of the issue… This stored procedure has valid syntax and compiles (in 5.1 & 5.4). […]

MySQL Group By

Many people are caught out by MySQL’s implementation of GROUP BY. By default MySQL does not require that you GROUP BY all non-aggregated columns. For example the following is an illegal query in SQL Server (as well as rather nonsensical); ?View Code MYSQLSELECT * FROM INFORMATION_SCHEMA.TABLES GROUP BY TABLE_SCHEMA; This will generate the following error; […]