Ask Your Question
2

How to change characters from é to é in MySQL to UTF8?

asked 2023-07-09 22:01:18 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2023-07-09 22:28:02 +0000

qstack gravatar image

To change characters from é to é in MySQL to UTF8, follow these steps:

  1. Check the current character set of the database by running the following query:

    SHOW VARIABLES LIKE '%char%';
    
  2. If the character set is not UTF8, you need to convert it to UTF8. You can do this by running the following query:

    ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    

    Replace "database_name" with the name of your database.

  3. Change the character set of the table(s) that contain the data you want to convert to UTF8. You can do this by running the following query:

    ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    

    Replace "table_name" with the name of your table.

  4. Update the data in the table to replace the characters "é" with "é". You can do this by running the following query:

    UPDATE table_name SET column_name = REPLACE(column_name, 'é', 'é'); 
    

    Replace "tablename" with the name of your table and "columnname" with the name of the column that contains the data you want to update.

  5. Finally, check that the data has been updated correctly by running a SELECT query.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-09 22:01:18 +0000

Seen: 16 times

Last updated: Jul 09 '23