MySQL

MySQL CheatSheet

Here is the list of some commonly used MySQL commands. It comes in handy when creating databases and troubleshooting issues related to character set and collation. # connect to database mysql -u user -p -h host database # check connections and processes show variables like '%conn%'; show status like '%conn%'; show processlist; # check character-set and collation show variables like '%character%'; show variables like '%collat%'; show table status where name = 'MY_TABLE'; show full columns from 'MY_TABLE'; # database and character sets alter database MY_DATABASE character set utf8 collate utf8_unicode_ci; alter table MY_TABLE character set utf8 collate utf8_unicode_ci; create database MY_DATABASE default character set = 'utf8' default collate = 'utf8_unicode_ci'; # create new t…