Little pieces of code you just can’t remember
Feel free to make suggestions. The rule is that it is something you might use infrequently, that you’d normally Google but it’s often hard to find.
### MySQL datetime
For use with NOW() in MySQL.
date('Y-m-d H:i:s')
Create a new database (UTF-8)
CREATE DATABASE mydb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci;
Add a user with all privileges
GRANT ALL PRIVILEGES ON `database_name`.* To 'user_name'@'localhost' IDENTIFIED BY 'password';