Topic: error when importing into mysql CHARSET

Example: in mysql backup file a word appears "envíalo", but after import the file into mysql using phpMyAdmin , then the same word appears like "envíalo" inside mysql table.

what I am doing wrong?

any idea any one?

Re: error when importing into mysql CHARSET

It could be any number of things, exports from MySQL are fairly tricky.
How did you generate the backup?

Re: error when importing into mysql CHARSET

the data is fine in the backup, i think the backup is creating the tables in a wrong way, because maybe i did export the tables wrong.

I think if I create the tables 1st, then import the data, it will be fine.

or maybe is the way i am importing

Do you have a file to create the just the tables?

i think i saw the post some where.

Re: error when importing into mysql CHARSET

That's not necessarily true. It's fairly easy for a backup of latin1 data to be incorrectly called a backup of utf8 data, for example.
If you send me a copy of the dump, I can take a look at it. My email address is smartys@ this domain.

Re: error when importing into mysql CHARSET

Smartys wrote:

That's not necessarily true. It's fairly easy for a backup of latin1 data to be incorrectly called a backup of utf8 data, for example.
If you send me a copy of the dump, I can take a look at it. My email address is smartys@ this domain.

this is my dump

--
-- Table structure for table `punbb_forums`
--

CREATE TABLE `punbb_forums` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `forum_name` varchar(80) NOT NULL default 'New forum',
  `forum_desc` text,
  `redirect_url` varchar(100) default NULL,
  `moderators` text,
  `num_topics` mediumint(8) unsigned NOT NULL default '0',
  `num_posts` mediumint(8) unsigned NOT NULL default '0',
  `last_post` int(10) unsigned default NULL,
  `last_post_id` int(10) unsigned default NULL,
  `last_poster` varchar(200) default NULL,
  `sort_by` tinyint(1) NOT NULL default '0',
  `disp_position` int(10) NOT NULL default '0',
  `cat_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `punbb_forums`
--

INSERT INTO `punbb_forums` VALUES (4, 'Todo General Colombia', 'Hablemos de nuestro hermoso país, chismecitos, la mas linda, el mas lindo, noticias, farandula etc..', NULL, NULL, 0, 0, NULL, NULL, NULL, 0, 2, 2);
INSERT INTO `punbb_forums` VALUES (3, 'Futbol Colombiano / Colombian Soccer', 'Habla sobre los equipos nacionales, sobre cual es la mejor barra o cual es la peor. Suave con los insultos!', NULL, NULL, 2, 8, 1204934027, 79, '555457370', 0, 0, 3);
INSERT INTO `punbb_forums` VALUES (5, 'Todo General Internacional', 'Hablemos de todo un poco, chismecitos, la mas linda, el mas lindo, noticias, farandula etc..', NULL, NULL, 0, 0, NULL, NULL, NULL, 0, 2, 2);
INSERT INTO `punbb_forums` VALUES (6, 'Que compras y Que vendes Colombia', 'Que Compras y que vendes es la solución de auto-servicio para la inclusión de productos para la venta, la vivienda en alquiler, los puestos de trabajo disponibles, y así sucesivamente. Se puede usar para encontrar Mercado de las cosas que quieres comprar o utilizar, así como la lista de todo lo que está en el mercado para la compra, alquiler, etc.', NULL, NULL, 1, 5, 1204932232, 76, '556040994', 0, 0, 4);
INSERT INTO `punbb_forums` VALUES (7, 'BARRAS Futbol Colombiano', 'Crea o encuentra una barra de tu equipo!\nGrupo de la barra en el forum, URL y descripcion de la barra.', NULL, NULL, 0, 0, NULL, NULL, NULL, 0, 1, 3);

-- --------------------------------------------------------

the data is ok, bud after importing, the characters change inside mysql table

Re: error when importing into mysql CHARSET

What about at the top of the dump? Is there a line that starts SET NAMES? If so, what does it say?

Re: error when importing into mysql CHARSET

Smartys wrote:

What about at the top of the dump? Is there a line that starts SET NAMES? If so, what does it say?

yeah this is what is there:




-- phpMyAdmin SQL Dump
-- version 2.10.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 07, 2008 at 03:55 PM
-- Server version: 5.0.27
-- PHP Version: 4.4.4

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `devic563_daniel`
--

-- --------------------------------------------------------

--

Re: error when importing into mysql CHARSET

When importing into phpMyAdmin, does it give you an option to pick the encoding? If so, pick latin1 and see if it works. If not, try picking utf8.
Like I said, exporting/importing can be tricky. wink

9 (edited by fhelik 2008-03-08 03:33)

Re: error when importing into mysql CHARSET

Smartys wrote:

When importing into phpMyAdmin, does it give you an option to pick the encoding? If so, pick latin1 and see if it works. If not, try picking utf8.
Like I said, exporting/importing can be tricky. wink

i just tried, but nothing, this are the images before importing and the table after importing

http://xs225.xs.to/xs225/08106/2126.png.xs.jpg

http://xs125.xs.to/xs125/08106/3901.png.xs.jpg

Re: error when importing into mysql CHARSET

Did you try importing it with the character set set via phpMyAdmin to utf8?

11

Re: error when importing into mysql CHARSET

Smartys wrote:

Did you try importing it with the character set set via phpMyAdmin to utf8?

I did work with utf8. it restore all the caracters right. but now if i post something like "envíalo" after submit it appears "envíalo" in the forum and in the mysql table.  :-(

my is :                           'lang_encoding' =>    'iso-8859-1',

Re: error when importing into mysql CHARSET

My guess is that phpMyAdmin exported the characters as UTF-8 rather than latin1, which is causing the mixture of collations. wink
You'll need to use a tool like iconv to convert the file to latin1/iso-8859-1.

13

Re: error when importing into mysql CHARSET

Smartys wrote:

My guess is that phpMyAdmin exported the characters as UTF-8 rather than latin1, which is causing the mixture of collations. wink
You'll need to use a tool like iconv to convert the file to latin1/iso-8859-1.

ok i think will try to reinstall punbb from zero.

any way what do you think are the settings when exporting from phpMyAdmin?

also is that iconv a plugin?

Re: error when importing into mysql CHARSET

http://www.gnu.org/software/libiconv/

And I would suggest not using phpMyAdmin for the backup, I would use the DB Management plugin.

And if you would send me the entire dump, I should be able to convert it for you.

15

Re: error when importing into mysql CHARSET

thank you man for your time, I will install the DB Management plugin.