• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How do I store UTF8 in MySQL?

W

webcanada

Guest
Hello all -

I'm trying to set up a table which will have fields that contain data in Chinese, Arabic, and other non-English languages. I assume the way to do this is to enable UTF8 for the database.

How do I do this in Plesk? Is it a MySQL command? I've tried doing ...

ALTER DATABASE roller DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

... where roller is the name of the database, but it comes back with a syntax error.

I have Plesk 7.5.4, but MySQL 3.23.58.

Thanks for your help,
Peter.
 
Thanks for the link! That is helpful.

Any idea why I am getting a syntax error when I try to issue:

CREATE TABLE Table1
(
column1 VARCHAR(5) CHARACTER SET latin1 COLLATE latin1_german1_ci
);

The error I get is:

MySQL said:

#1064 - You have an error in your SQL syntax near 'CHARACTER SET latin1 COLLATE latin1_german1_ci
)' at line 3

Thanks,
Peter.
 
Hmm - yes, I did use that part of the manual. I see the reference to 4.1 now.

Don't I have to declare the column as being in that character set before using it?

I'm confused. :(
 
You are able to create a UTF supported database.
Or you are able to convert an table record if i'm correct.
I must say i dont have any experience with this.

See also: 8.4.6 of the link i did send to you!
 
Originally posted by webcanada
Hmm - yes, I did use that part of the manual. I see the reference to 4.1 now.

Don't I have to declare the column as being in that character set before using it?

I'm confused. :(

Character collations is not supported on table/row level in MySQL versions older than 4.1.x I think (on some level it might be supported in the 4.0.x versions).

But COLLATIONS is not supported in the old 3.xx versions. You need to upgrade!
 
Back
Top