How can I change the CHAR_SET of an existing database/table in phpmyadmin ?
The collation of tables can be changed by clicking the table name -> operations but I did not find how to change the CHAR_SET
I am trying to export a 5.5 database with utf8mb4 to a 5.0 database [no utf8mb4]
best regards
for people having the same problem here is a post that has the SQL solution on StackOverflow
asked Apr 23, 2014 at 0:54
1
If you want to change the table default character set
to a new character set, use a statement like this:
ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;
So query will be:
ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8mb4;
Font: How to change the default charset of a MySQL table?
In PHPMyadmin:
You need to go to phpmyadmin > information_schema > schemata > change your DEFAULT_CHARACTER_SET_NAME with query
Font: Change default Charset
answered Apr 23, 2014 at 0:57
Lucas HenriqueLucas Henrique
1,3801 gold badge11 silver badges15 bronze badges
2
This article describes how to use phpMyAdmin to change the collation settings for MySQL databases and tables.
About character sets and collation
MySQL enables you to store and process data in a wide variety of languages using various character sets. For some operations, such as comparing two strings, MySQL uses a set of rules to determine equality and sorting order. This set of rules is known as a collation.
You may have to change the collation for a database or table based on the character set you want to use for string data. You can do this by using the phpMyAdmin tool in cPanel.
Changing the default collation for a database
To change the default collation for a database, follow these steps:
- Log in to cPanel.
If you do not know how to log in to your cPanel account, please see this article.
- Open phpMyAdmin:
- If you are using the Jupiter theme, on the Tools page, in the Databases section, click phpMyAdmin:
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click phpMyAdmin:
- If you are using the Jupiter theme, on the Tools page, in the Databases section, click phpMyAdmin:
- The phpMyAdmin administration page appears in a new window. In the left pane, click the name of the database you want to modify.
- On the top menu bar, click Operations.
Under Collation, select the collation that you want for the database, and then click Go.
This setting only affects new tables that you create. Any existing tables maintain their current collation setting.
Changing the collation for a table
To change the collation for a database table, follow these steps:
- Log in to cPanel.
If you do not know how to log in to your cPanel account, please see this article.
- Open phpMyAdmin:
- If you are using the Jupiter theme, on the Tools page, in the Databases section, click phpMyAdmin:
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click phpMyAdmin:
- If you are using the Jupiter theme, on the Tools page, in the Databases section, click phpMyAdmin:
- The phpMyAdmin administration page appears in a new window. In the left pane, click the + icon next to the name of the database that contains the table you want to modify. phpMyAdmin expands the view to show the database's tables.
- Click the name of the table you want to modify.
- On the top menu bar, click Operations.
- Under Table options, in the Collation list box, select the collation that you want for the table, and then click Go.
More Information
For more information about character sets and collation in MySQL, please visit //dev.mysql.com/doc/refman/5.5/en/charset-general.html.