1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

How do I store UTF8 in MySQL?

Discussion in 'Plesk for Linux - 8.x and Older' started by webcanada, Nov 23, 2005.

  1. webcanada

    webcanada Guest

    0
     
    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.
     
  2. rvdmeer

    rvdmeer Guest

    0
     
  3. webcanada

    webcanada Guest

    0
     
    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.
     
  4. rvdmeer

    rvdmeer Guest

    0
     
  5. webcanada

    webcanada Guest

    0
     
    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. :(
     
  6. rvdmeer

    rvdmeer Guest

    0
     
    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!
     
  7. Whistler

    Whistler Guest

    0
     
    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!
     
Loading...