-2

I started my Project with UTF8 Database for the development. At the time of project completion, my Professor gave me the database of type Latin1. Because of Type Conflicting my project is not working properly, result my server side code doesn't access the database.

I tried much conversion: My Professors database into UTF8, but it failed. Still I’m facing the issue. Kindly assist me in this regards.

Thank you !

B.Balamanigandan
  • 4,713
  • 11
  • 68
  • 130
MikaelTlp
  • 3
  • 1
  • 1
    Here is a [link](https://blogs.law.harvard.edu/djcp/2010/01/convert-mysql-database-from-latin1-to-utf8-the-right-way/) which might be useful to you. – Tim Biegeleisen Dec 18 '15 at 07:53
  • The easiest way would probably be changing the connection encoding. But this needs more detailed information on what exactly goes wrong, etc.. – Pekka Dec 18 '15 at 09:27
  • What are you seeing? (Give us an example.) What is the declaration of the `CHARACTER SET`? (Show us `SHOW CREATE TABLE`.) How are you connecting? – Rick James Dec 19 '15 at 18:39

2 Answers2

0

You may try a charset converter like MySQL charset converter

This PHP script can be used to convert your MySQL database tables from latin1-to-UTF8 while retaining the integrity of all internal multibyte characters.

Alfred
  • 21,058
  • 61
  • 167
  • 249
  • Thank you for your response ! The datas are displayed but when I have an accented letter the rest of the content is not displayed. I have only a part of datas who are displayed. – MikaelTlp Dec 18 '15 at 08:40
  • will converting to utf fix your problem? if then, you may try it. – Alfred Dec 18 '15 at 09:01
  • It fix a part of the problem. Only a part of the datas are displayed. – MikaelTlp Dec 18 '15 at 09:08
-1

You could try this: ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;

replace charset_name with latin1

You can also change columns individually

ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET latin1;

krpa
  • 84
  • 1
  • 13