This note is about the problems that I met while using MySQL.
1. Install
Just use apt-get install, easy, fast and enough to use.
$ sudo apt-get install mysql-server
2. Create User
Read the doc from official site.
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
3. Grant
Read the doc from official site.
mysql> GRANT ALL ON db1.* TO 'jeffrey'@'localhost';
4. Encoding
Show the encoding type of current database.
mysql> show variables like "character_set_database";
mysql> show variables like "collation_database";
Show the encoding type of a table
mysql> show full columns from mytable;
Change the encoding type of a column
mysql> alter table table_name modify col_name varchar(255) character set utf8 collate utf8_general_ci;
竟然无法拒绝你的打赏
