This topic describes how to use Navicat for MySQL to modify the character set encoding of MySQL databases for Web Hosting and Simple Application Server instances.
Prerequisites
Ensure that Navicat for MySQL is installed.
Download Navicat for MySQL from the Navicat official website.
Procedure
- Obtain the database information.
- Web Hosting management pageLog in to the Web Hosting console.
- ActionsManageFind the Web Hosting instance and click in the column.
- Database InformationIn the left-side navigation pane, click .
- On the Database Information page, view your database connection details.Note If you forget the database password, reset it. For more information, see Reset the password of a Web Hosting database.

Start Navicat for MySQL.
From the menu bar, select .
In the MySQL - New Connection dialog box, enter the database information and click OK.
Parameter
Description
Connection Name
Enter a name for the connection.
Host
Enter the database endpoint.
Port
Enter the connection port for the database. The default port for MySQL is 3306.
User Name
Enter the username for the database.
Password
Enter the password for the database.
In the left-side navigation pane, right-click the name of the connected database and select Command Line Interface.
In the command input box of the Command-line Interface dialog box that appears, run the following command to view the database character set encoding information.
show variables like "char%"The command returns the following character set encoding details.
mysql> show variables like "char%"; +-------------------------+-------------------------------------------+ | Variable_name | Value | +-------------------------+-------------------------------------------+ | character_set_client | utf8 | | character_set_connection| utf8 | | character_set_database | gbk | | character_set_filesystem| binary | | character_set_results | utf8 | | character_set_server | gbk | | character_set_system | utf8 | | character_sets_dir | /usr/local/mysql/share/mysql/charsets/ | +-------------------------+-------------------------------------------+ 8 rows in setIn the command input field, run the following command to modify the character set encoding of the database.
alter database <database_name> character set <charset_name>
Results
The following example shows the output after changing the database character set encoding to utf8.
mysql> alter database xxx character set utf8;
Query OK, 1 row affected
mysql> show variables like "char%";
+-------------------------------+----------------------------------------+
| Variable_name | Value |
+-------------------------------+----------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | gbk |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/mysql/charsets/ |
+-------------------------------+----------------------------------------+
8 rows in set