Fixing not being able to log in to fresh MySQL installation on Ubuntu

If you did a fresh installation on a new Ubuntu (~18.04) version, you may find that it is not possible to log in to MySQL with its root user, unless you do so as Ubuntu’s root user. Here’s how to fix it:

Enabling Global MySQL Log in Ubuntu

If you use (You should!) MySQL Prepared Statements, you may not be able to see how the final MySQL queries looks like, within your application, with all the bindings put into place. This is how to view them:

[Today I Learned] Insert and Update rows with MySQL “ON DUPLICATE KEY UPDATE”

You can use MySQL’s “ON DUPLICATE KEY UPDATE” to insert and update rows when your query faces a “Duplicate Key” error.