Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Phpmyadmin Export And Collation Problems
TavoxPeru
post Jul 26 2007, 07:10 AM
Post #1


Super Member
Group Icon

Group: [HOSTED]
Posts: 750
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



I have a very strange problem with the Exported sql file generated by phpMyAdmin that never happen to me before, the problem is that my data contains some strange characters but when i see them on screen it shows correctly, instead of showing the spanish characters á, é, í, ó, ú and ñ it shows others, for example instead of á shows á, instead of ó shows ó, etc.

The other problem i have is that when i use Internet Explorer and want to download the generated sql file to my machine nothing happens, it seems that the export script works completely but it never shows the Save As... dialog box. This problem never occurs if i use Firefox.

The following are some data of the phpMyAdmin welcome page:
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_unicode_ci
phpMyAdmin - 2.9.0.2
Server version: 4.1.21-standard
Protocol version: 10
MySQL client version: 4.1.21
Used PHP extensions: mysql
Best regards,
Go to the top of the page
 
+Quote Post
yordan
post Jul 26 2007, 12:30 PM
Post #2


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 1,980
Joined: 16-August 05
Member No.: 7,896



OK, the strange character set is a very common problem.
it's due to the way you defined the national characterset when creating the database.
Probably, when you created the database, you created it with a non-spanish character set, probably utf8_unicode_ci.
So, you entered some spanish characters with your PC which has a spanish keyboard and a spanish-defined national language, and mysql translated them in order to be inserted in the non-spanishly-defined database tables.
When reading the data from your application, the characters where oppositely correctly converted from non-spanish database characters to spanish displayable characters on your PC.
However, when performing an export, the data in the exported sql file were the in the database-defined character set.
This means that if you have to re-create the database (for instance for installing your program to another site) you will have to re-create the database with the same character set as in the current database.
This is my recommendation in order to be able to use your current export file.
This is not very dangerous, as long as everything remains the same way - spanish people entering data in a utf8_unicode_ci database. this will probably be different if greek people or french people try to read your data.
Of course, for your next customer, if you star from the very beginning, on a completely empty database, I recommend to correctly define the database characterset, probably utf8_spanish_ci, or utf8_spanish2_ci. Then everything will be coherent, spanish characters intered in a spanish database, the export file will also have spanish characters.
I hope that you were able to correctly understand my explanations concerning this characterset problem.
So, now, I mus confess that I am also trapped everytime with this kind of problems, and I am able to explain the problem but I was never able to correctly solve it. Simply, I tell my customer "ask your dba to correctly define the national characterset". And hopefully, I am not the concerned dba, so this is not my task. Else I would have to confess that I am unable to solve it...
Go to the top of the page
 
+Quote Post
SilverFox
post Jul 26 2007, 03:08 PM
Post #3


Premium Member
Group Icon

Group: Members
Posts: 206
Joined: 26-February 07
From: Texas
Member No.: 20,598



I believe you can convert it to another char_set when exporting.
Go to the top of the page
 
+Quote Post
yordan
post Jul 26 2007, 04:32 PM
Post #4


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 1,980
Joined: 16-August 05
Member No.: 7,896



QUOTE(SilverFox @ Jul 26 2007, 05:08 PM) *
I believe you can convert it to another char_set when exporting.

Probably yes. But I would like to know the way how to do it. I found nothing in the phpmyadmin menus, neither than in the phpbb menus. Seems that the import/export tools are for backup/restore purposes, the same way on the same system. They seem not to be intended as real migrational tools.
Moreover, I would say that reading the sql file using notepad is not the correct way for dianosing these kinds of troubles. The best way should be to export one table, and import inside an empty table, and use phpmyadmin to browse the new table. And even then, the diagnostic could be false, you probably should also use your php program in order to display the new table the same way as the old one.
Go to the top of the page
 
+Quote Post
TavoxPeru
post Jul 26 2007, 06:06 PM
Post #5


Super Member
Group Icon

Group: [HOSTED]
Posts: 750
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



yes, yordan i'm able to correctly understand your explanations, thank you very much. Now, after some tests i made i discover that another reason for this issue happens is related with the browser and with which character set it uses, so, what i do to solve this, is by setting up the UTF-8 character set to my browser.

SilverFox I'm almost pretty sure that you can't convert the char_set when exporting, also i never see this option available to set up on the configuration file of phpMyAdmin, where i see something similar is in the import page, in this page you are been able to set the character set of the sql file that you want to import.

The import/export tools are for restore/backup purposes, i have the chance to use it a lot of times and i can say that it works very fine in almost all situations.

Best regards,
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Nero Problems(28)
  2. Freebsd Burning & Installation Problems(4)
  3. PHP Problems(4)
  4. Web Browser And Taskbar Problems (web Browser Disappears)(7)
  5. Hitman: Blood Money(8)
  6. Windows Problems "new Series"- Xp Home Edition Activation Issue(6)
  7. Problems Installing Vista(13)
  8. Screensaver Problems(10)
  9. User Authentication Session Handling Problems(14)
  10. Installation Gone Bad...(14)
  11. Office 2007 Document Problems(12)
  12. Problems With Php Saving Data Into Mysql(6)
  13. External Hard Disk Problems(11)
  14. Internet Connection Sharing Problems(2)
  15. Php Problems(1)
  1. Phpmyadmin(1)
  2. Firefox Problems..(6)
  3. Connection Problems(9)
  4. Phpmyadmin Doesn't Work On Gamma Server(4)
  5. Two Problems.(5)
  6. Networking Problems(4)
  7. Existing Problems(4)
  8. Email Problems(5)
  9. Updating Graphics Card Problems(11)
  10. Phpmyadmin Continues To Have Errors.(17)
  11. Gimp: Saving As... Issues(3)
  12. Image Problems With Windows 2000(8)
  13. Wamp Server Problems(4)


 



- Lo-Fi Version Time is now: 7th September 2008 - 01:03 AM