· 8 years ago · Mar 14, 2018, 06:46 PM
1mysql> USE dm_core_test
2Reading table information for completion of table and column names
3You can turn off this feature to get a quicker startup with -A
4
5Database changed
6mysql> SET sql_auto_is_null = 0;
7Query OK, 0 rows affected (0.00 sec)
8
9mysql> SET SESSION sql_mode = 'ANSI,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,TRADITIONAL';
10Query OK, 0 rows affected (0.00 sec)
11
12mysql> DROP TABLE IF EXISTS `companies`;
13Query OK, 0 rows affected (0.04 sec)
14
15mysql> DROP TABLE IF EXISTS `invoices`;
16Query OK, 0 rows affected (0.01 sec)
17
18mysql> SHOW TABLES LIKE 'companies';
19Empty set (0.00 sec)
20
21mysql> SHOW VARIABLES LIKE 'character_set_connection';
22+--------------------------+-------+
23| Variable_name | Value |
24+--------------------------+-------+
25| character_set_connection | utf8 |
26+--------------------------+-------+
271 row in set (0.00 sec)
28
29mysql> SHOW VARIABLES LIKE 'collation_connection';
30+----------------------+-----------------+
31| Variable_name | Value |
32+----------------------+-----------------+
33| collation_connection | utf8_general_ci |
34+----------------------+-----------------+
351 row in set (0.00 sec)
36
37mysql> CREATE TABLE `companies` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY(`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;
38Query OK, 0 rows affected (0.07 sec)
39
40mysql> SHOW TABLES LIKE 'invoices';
41Empty set (0.00 sec)
42
43mysql> CREATE TABLE `invoices` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `nr` INTEGER, `owner_id` INT(10) UNSIGNED NOT NULL, PRIMARY KEY(`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;
44Query OK, 0 rows affected (0.16 sec)
45
46mysql> CREATE INDEX `index_invoices_owner` ON `invoices` (`owner_id`);
47Query OK, 0 rows affected (0.06 sec)
48Records: 0 Duplicates: 0 Warnings: 0
49
50mysql>