5 ms·
Anything similar for MySQL?
by markdog12 7y ago
Anything similar for MySQL?
- LeonM 7y agoDon't use --password for the CLI
- tyingq 7y agoDon't use UNIX_TIMESTAMP() or FROM_UNIXTIME(). Both overflow in 2038.
- perlgeek 7y agoI hoped you were kidding me, but no: $ perl -wE 'say scalar localtime 2177449200' Sat Jan 1 00:00:00 2039 > select FROM_UNIXTIME(2177449200); +---------------------------+ | FROM_UNIXTIME(2177449200) | +---------------------------+ | NULL | +---------------------------+ 1 row in set (0.000 sec) I work on a code base where the word UNIX_TIMESTAMP occurs 400 times :(
- segmondy 7y agoYes, don't use MySQL, use Postgres.
- BenMorganIO 7y agoWhen to Use MySQL? Never.
- b3b0p 7y agoI wanted to come back and ask the same thing, only to guess there would be some snarky replies. Sure enough, there are, but sometimes we have to make the best of what we do have. I can't switch to PostgreSQL because some posters on Hacker News think or say MySQL is terrible or shouldn't be used for technical reasons. There are many highly successful profitable companies, small businesses, and start ups that have built their backend using MySQL. I'm not saying MySQL is better either. To the topic of the post, if anyone knows about succinct list similar to this for MySQL that would be great. I tried to search for something after reading this, but wasn't having much success.
- captainmuon 7y agoOne would be: Never use "utf8" character set, only "utf8mb4". "utf8" is limited to those characters that only use four bytes, and everything else will be truncated. "utf8mb4" is what you want when you think about UTF-8.