MySQL useful commands

Some typical useful MySQL commands. The following statements were tested with MySQL version 5.1 and 5.5. Create database: mysql>CREATE SCHEMA IF NOT EXISTS `db_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; Create user: mysql> create user ‘user_id’@’localhost’ identified by ‘xxx’; Query OK, 0 rows affected (0.00 sec) Grant only select on db_name to user user_id@localhost. Ofcource … Read moreMySQL useful commands