ALTER TABLE tbl_name ALTER column_name SET DEFAULT new_value;
mysql> SHOW VARIABLES LIKE 'char%'; SHOW VARIABLES LIKE 'collation%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+----------------------+--------------------+
3 rows in set (0.00 sec)
ALTER DATABASE databasename CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
//Server side, so every new table will be utf8 unicode
SET character_set_server = 'utf8';
SET collation_server = 'utf8_unicode_ci';
CREATE TABLE table_name(
column_name data_type,
Column_name data_type DEFAULT ‘value’
);
Code Example |
---|
Sql :: mysql show tables in database |
Sql :: sql order by timestamp |
Sql :: truncate left characters mysql |
Sql :: convert series number to date in sql |
Sql :: ALL_TAB_PARTITIONS |
Sql :: mysql mediumint max value |
Sql :: how to change owner in postgres |
Sql :: mysql error codeigniter |
Sql :: postgresql create table with boolean column |
Sql :: sqlserver create table from select |
Sql :: how to delete table sqlite |
Sql :: if then else sqlite |
Sql :: sql insert query |
Sql :: oracle trace file |
Sql :: select tables with name like mysql |
Sql :: oracle substring |
Sql :: mysql sysdate - 1 day |
Sql :: show tables sql |
Sql :: select tables from mysql database |
Sql :: oracle create as select |
Sql :: python escape string for sql |
Sql :: backup postgres database |
Sql :: get only first row mysql |
Sql :: sql update from different table |
Sql :: sql problems |
Sql :: python sqlite3 prepared statement |
Sql :: grant all privileges mysql |
Sql :: sql where contains |
Sql :: current year sql |
Sql :: sql truncate statement |