How to show a MySQL warning that just happened?

SHOW WARNINGS is the only method I’m aware of, but you have to run it immediately after a query that had warnings attached to it. If you ran any other queries in between, or dropped the connection, then SHOW WARNINGS won’t work. The MySQL manual page for SHOW WARNINGS doesn’t indicate any other methods, so … Read more

brew services start mysql vs mysql.server start

brew services (services in general) will restart automatically after rebooting; the other (mysql.server start) will not. That is the difference. Executing the command with no options should yield, tigger2:Downloads efrisch$ brew services brew services [-v|–verbose] [list | run | start | stop | restart | cleanup] […] Easily start and stop formulae via launchctl. With … Read more

MySQL Version Control – Subversion

This is not a MySQL-related solution in itself, but we’ve had a lot of success with a product called liquibase. (http://www.liquibase.org/) It’s a migration solution which covers many different database vendors, allowing all database changes to be coded in configuration files, all of which are kept in Subversion. Since all configuration is kept in XML … Read more

How to require SSL for all remote users

The (formerly) accepted answer by Honza seems incorrect, see its comments. It seems not possible to use a GRANT query to alter multiple users at once since MySQL does not support wildcards for user names. As you suggested yourself you can alter records in the mysql.user table directly using an UPDATE query and as Marc … Read more

MySQL column type “TIMESTAMP” implicitly includes “NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP”

In MySQL 5.6.5 there are several updates regarding this initialization, you can see on this link (Automatic Timestamp Properties Before MySQL 5.6.5). If you’re using MySQL <= 5.6.5, in order to ignore this initialization you need to set the DEFAULT value to 0 or NULL with NULL allowed. CREATE TABLE tbl ( field1 TIMESTAMP DEFAULT … Read more

MySQL TINYINT as unsigned

UNSIGNED is an attribute which can be added to many types. From the documentation: data_type: BIT[(length)] | TINYINT[(length)] [UNSIGNED] [ZEROFILL] | SMALLINT[(length)] [UNSIGNED] [ZEROFILL] | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL] | INT[(length)] [UNSIGNED] [ZEROFILL] | INTEGER[(length)] [UNSIGNED] [ZEROFILL] | BIGINT[(length)] [UNSIGNED] [ZEROFILL] | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL] | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL] | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL] | DECIMAL[(length[,decimals])] [UNSIGNED] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)