Creating a DB in localhost,then moving to server.Got a unicode(utf8) character prob

Discussion in 'MySQL' started by Embrance, Dec 31, 2006.

  1. #1
    Ok,so,i created a site in Greek,with e107 cms. I have added some text. On my localhost all text is showing fine.

    Now on my localhost i have this configuration:
    PHP Version
    5.0.5
    MySQL
    5.0.15-nt
    MySQL connection collation:utf8_general_ci
    MySQL charset: UTF-8 Unicode (utf8)

    on the server i have this:
    PHP Version
    4.4.3
    MySQL
    5.0.27-standard
    MySQL connection collation:utf8_general_ci
    MySQL charset: UTF-8 Unicode (utf8)

    So i make a gzipped backup of the DB,and try to import it to server.But on the site i see "???" and such symbols.I thought i could be the problem that i gzipped it,so i just executed export(not to a file),so i could copy-paste the result from one tab to another and even in the browser's window(Fireofx)the chars show like weird symbols.

    I read somewhere that this is a MySQL problem,but im not sure about that. COuld anyone help on direct me on this?
     
    Embrance, Dec 31, 2006 IP
  2. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is probably due to the fact you are importing Mysql 5. to mysql 4.
    I think that if you do it with a plain txt file it will work (just remove the extra lines at the end of the CREATE TABLE query).
     
    maiahost, Jan 2, 2007 IP
  3. Embrance

    Embrance Well-Known Member

    Messages:
    192
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #3
    But both have MySQL v5 as you can see...
     
    Embrance, Jan 2, 2007 IP
  4. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ahh I was looking at the php. Sorry long day and night. Anyway if you post the initial table creation code I might be able to help.
     
    maiahost, Jan 2, 2007 IP
  5. Embrance

    Embrance Well-Known Member

    Messages:
    192
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #5
    OK heres a part:
    then there are some inserts.I tried to dow aht you said(copy to a text editor and then import,but even in the browser window the Greek Chars look like chinese or somehting...,on the site i have on localhost however,they are ok)
     
    Embrance, Jan 3, 2007 IP
  6. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #6
    OK what you described seems like a mysql charset problem (or collation). You can change it in phpmyadmin - select the database and click operations - it's at the bottom. I've never dealt with Greek characters but you have a couple of options there : greek_bin and greek_general_c . This is under mysql 4.
    also remove this :

    ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci

    from the above statement
     
    maiahost, Jan 3, 2007 IP
  7. Embrance

    Embrance Well-Known Member

    Messages:
    192
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #7
    ok so here what i have done:
    I tried these combinations:
    greek_bin and greek_general_ci and the utf_genral_ci...
    I went to localhost,then to phpmyadmin and then to operations.Changed it to the above values(tested with both 3 of them),made sure i have same setting on my server and tried to import.Same result.Then i noticed this:
    No matter how many times i change the Collation type via Operations,it stays as it was(However on the operation is shows to the newest changed value wich was utf_general_ci).Here a pic:
    http://img465.imageshack.us/img465/2812/screenhunter01jan061011vr5.jpg

    I once had this issue solved but that was like a year ago and cant remember what i did..
    Somehow,i managed to create a txt file(unicode)and have all these data in there...I think i did it on MySQL v4,so now thats another issue :/
     
    Embrance, Jan 5, 2007 IP