Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: MySQL importing error
And you can keep using that script. Then you will simply have to edit the script and add the option -Q after mysqldump.
Offline
Re: MySQL importing error
I think I figured it out. Thanks to what you said about Latin1 Senser.
When importing into phpMyAdmin there is an option to select the character set. By default it is UTF. I changed it to Latin1 and hey presto the characters display properly!
Thanks a lot Senser, hope this helps someone else too.
Offline
Re: MySQL importing error
Maybe I spoke too soon – the TXP import is now fine as I mentioned above, now I have issues with a punBB and PhotoPost import. Those show up with messed up characters.
I imported them both in UTF and Latin1, both appear incorrect. Any idea how these should be imported? Character set?
Offline
Re: MySQL importing error
Still having problems with this. PunBB and PhotoPost imports don’t work. I have tried from the command line too. Looks like Norwegian characters are displayed properly in the punBB database, but not properly in the browser.
TXP database is the reverse – some strange characters in the database, displays properly in the browser.
How to export/import this thing?!!
BTW, -Q command made no difference.
Offline
Re: MySQL importing error
-Q is for quoting special chracters. It was to solve your problem in the first post with the privs table. It has nothing t do with charsets.
You might try to import export the tables for textpattern seperately (and differently) from punbb and photopost. Try asking on their support forums which charset problems can appear and how to solve them.
Offline
Re: MySQL importing error
Thanks Senser. I have in fact exported the databases separately. There aren’t many options that I know of for exporting.
Have posted now on PhotoPost and PunBB forums. Hopefully someone will know. I can’t be the first person to have this problem! Appreciate your reply.
Offline
Re: MySQL importing error
Senser, you may be interested to know that it does not appear to be an import error. Rather, it seems to be a text encoding error.
In the current site, Textpattern is set to UTF in the meta tag, while PunBB and PhotoPost are by default iso-8859-1 or Latin1.
In the new site, all the files were copied and sent over, no editing at all. They are the same.
On the new site, when viewing through Firefox and Safari (both by default are iso-8859-1), Textpattern is ok but not PunBB and PhotoPost. If I manually change the text encoding to iso-8859-1 (Latin1), then the characters suddenly display properly.
I find this strange, since by default FF and Safari use iso-8859-1. Seems in this case, I have to do it manually.
The only difference between the sites now is the DNS name servers. I only see the new site by editing the /etc/hosts file on my OSX machine.
Weird, could this be because the DNS changes have not been made. Shot in the dark perhaps.
Offline
Re: MySQL importing error
OK, looks like the error is caused by TextDrive, which uses UTF-8 as the default everywhere
That’s why Textpattern works fine with Norwegian characters (as it is in UTF), while punBB and PhotoPost, both iso-8859-1, don’t work properly unless one changes the default encoding in the browser.
Is there a way around this?
Offline
Re: MySQL importing error
It’s not textdrive’s fault, it was a poor choice of defaults on the part of the developers of the mysql-client libraries. I believe they have changed that since for more recent versions. See:
http://bugs.mysql.com/bug.php?id=9948
The fix is for PHP-Applications to specify the charset of the db-connection. Usually the easiest way to do that is with mysql_query("SET NAMES utf8") or something similar. You can find out more about this in the mysql-manual.
Offline
Re: MySQL importing error
Sencer, I realise its not TXD’s fault, I just want to solve the problem :0
TXD support suggested “converting the data to utf-8. There are a lot tools which can do that (iconv), but the most simple is probably to load the database dump in SubEthaEdit and convert it to UTF-8 via the menu”.
I tried converting with Text Wrangler but that produces SQL errors. I could try iconv, but I would still have problems with problems with punBB and PhotoPost, since they are iso-8859-1.
Someone suggested I could change the collation of the database via phpMyAdmin, but I don’t see how that would help, since 4.1 is already iso-8859-1 I believe.
I am not going to be able to change the code of punBB and PP to specify the charset of the db connection, so I feel really stumped.
Offline