The MySQL character set is diverse. The following lists three of the most common ways to view MySQL character sets. This method is for your reference. I hope you can learn about MySQL databases.
1. view the MySQL database server and MySQL character set.
- Mysql> show variables like '% char % ';
- + -------------------------- + ------------------------------------- + ------
- | Variable_name | Value | ......
- + -------------------------- + ------------------------------------- + ------
- | Character_set_client | utf8 |... -- client Character Set
- | Character_set_connection | utf8 | ......
- | Character_set_database | utf8 | ...... -- database Character Set
- | Character_set_filesystem | binary | ......
- | Character_set_results | utf8 | ......
- | Character_set_server | utf8 | ...... -- server Character Set
- | Character_set_system | utf8 | ......
- | Character_sets_dir | D: \ MySQL Server 5.0 \ share \ charsets \ | ......
- + -------------------------- + ------------------------------------- + ------
2. view the MySQL Character Set of the MySQL DATA table.
- mysql> show table status from sqlstudy_db like '%countries%';
- +-----------+--------+---------+------------+------+-----------------+------
- | Name | Engine | Version | Row_format | Rows | Collation |......
- +-----------+--------+---------+------------+------+-----------------+------
- | countries | InnoDB | 10 | Compact | 11 | utf8_general_ci |......
- +-----------+--------+---------+------------+------+-----------------+------
3. view the MySQL Character Set of the MySQL DATA column.
- mysql> show full columns from countries;
- +----------------------+-------------+-----------------+--------
- | Field | Type | Collation | .......
- +----------------------+-------------+-----------------+--------
- | countries_id | int(11) | NULL | .......
- | countries_name | varchar(64) | utf8_general_ci | .......
- | countries_iso_code_2 | char(2) | utf8_general_ci | .......
- | countries_iso_code_3 | char(3) | utf8_general_ci | .......
- | address_format_id | int(11) | NULL | .......
- +----------------------+-------------+-----------------+--------
-
How to modify the default Character Set of mysql
Role of MySQL Foreign keys in Databases
How MySQL defines foreign keys
MySQL foreign key syntax
MySql stored procedure with Parameters