The following articles mainly describe all the related parameters set in the MySQL Character Set UTF8. After installation, we have set the MySQL character set (the best combination with PHP, set it to utf8. The specific operations are as follows. However, MySQL (the best combination with PHP) SHOWVARIABLESLIKEcollation _
The following articles mainly describe all the related parameters set in the MySQL Character Set UTF8. After installation, we have set the MySQL character set (the best combination with PHP, set it to utf8. The specific operations are as follows. However, MySQL (the best combination with PHP) SHOWVARIABLESLIKE 'collation _
The following articles mainly describe all the related parameters set in the MySQL Character Set UTF8. After installation, we have set the MySQL character set (the best combination with PHP, set it to utf8. The specific operations are as follows.
However
- MySQL (best combination with PHP)> show variables like 'collation _ % ';
- + ---------------------- + ------------------- +
- | Variable_name | Value |
- + ---------------------- + ------------------- +
- | Collation_connection | latin1_swedish_ci |
- | Collation_database | utf8_general_ci |
- | Collation_server | utf8_general_ci |
- + ---------------------- + ------------------- +
- 3 rows in set (0.00 sec)
-
- MySQL (best combination with PHP)> show variables like 'character _ set _ % ';
- + -------------------------- + ------------------------------------------------ +
- | Variable_name | Value |
- + -------------------------- + ------------------------------------------------ +
- | Character_set_client | latin1 |
- | Character_set_connection | latin1 |
- | Character_set_database | utf8 |
- | Character_set_results | latin1 |
- | Character_set_server | utf8 |
- | Character_set_system | utf8 |
- | Character_sets_dir | D: \ data \ MySQL (the best combination with PHP) Server 4.1 \ share \ charsets/|
- + -------------------------- + ------------------------------------------------ +
- 7 rows in set (0.00 sec)
It is found that the property of the line mark is not utf8.
Modify the my. ini file and set
The following is a code snippet:
- [Client]
- Default-character-set = utf8
- [MySQL (best combination with PHP)]
- Default-character-set = utf8
- [MySQL (the best combination with PHP) d]
- Default-character-set = utf8
-
Copy my. ini file to the windows directory
The following code snippet starts the MySQL character set (the best combination with PHP:
- MySQL (best combination with PHP)> show variables like 'character _ set _ % ';
- + -------------------------- + ------------------------------------------------ +
- | Variable_name | Value |
- + -------------------------- + ------------------------------------------------ +
- | Character_set_client | utf8 |
- | Character_set_connection | utf8 |
- | Character_set_database | utf8 |
- | Character_set_results | utf8 |
- | Character_set_server | utf8 |
- | Character_set_system | utf8 |
- | Character_sets_dir | D: \ data \ MySQL (the best combination with PHP) Server 4.1 \ share \ charsets/|
- + -------------------------- + ------------------------------------------------ +
- 7 rows in set (0.00 sec)
-
- MySQL (best combination with PHP)> show variables like 'character _ set _ % ';
- + -------------------------- + ------------------------------------------------ +
- | Variable_name | Value |
- + -------------------------- + ------------------------------------------------ +
- | Character_set_client | utf8 |
- | Character_set_connection | utf8 |
- | Character_set_database | utf8 |
- | Character_set_results | utf8 |
- | Character_set_server | utf8 |
- | Character_set_system | utf8 |
- | Character_sets_dir | D: \ data \ MySQL (the best combination with PHP) Server 4.1 \ share \ charsets/|
- + -------------------------- + ------------------------------------------------ +
- 7 rows in set (0.00 sec)
Everything is normal. Create a database: the following code snippet:
- Create table t_sysuser (
- USERID integer not null auto_increment,
- USERNAME varchar (30 ),
- PASSWORDS varchar (30 ),
- DEPTNO varchar (30 ),
- HEADSHIP varchar (30 ),
- SEX varchar (4 ),
- TEL varchar (18 ),
- EMAIL varchar (30 ),
- URL varchar (30 ),
- PCALL varchar (20 ),
- USERPHOTO varchar (255 ),
- FACEREFUTIME integer,
- FACELANGUAGE varchar (1 ),
- LASTMODIF varchar (30 ),
- LASTMDATE datetime,
- CREADTOR varchar (30 ),
- CREATDATE datetime,
- Prima (the most comprehensive virtual host Management System) ry key (USERID)
- ) ENGINE = InnoDB default charset = utf8;
All done.