<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Get problem when importing alternateNames table into MySQL"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "Get problem when importing alternateNames table into MySQL"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ Hello,

I've created table using UTF-8 character set:

CREATE TABLE `alternatenames` (
....
) CHARACTER SET utf8 ;

Then I imported alternateNames.txt dump into this table.

The problem is some data is corrupted now. For example, when I try to do this query:

SELECT * FROM geo.alternatenames where geonameid = '2078025' AND isolanguage = 'ru'

I get "ÐÐ´ÐµÐ»Ð°Ð¸Ð´Ð°" instead of "Аделаида".

I wonder how can I fix it?

]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2829</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2829</link>
				<pubDate><![CDATA[Sat, 22 Sep 2007 14:18:31]]> GMT</pubDate>
				<author><![CDATA[ Alexey]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ Hi Alexey

It is not necessarily a problem with the import. It could be a problem with your display encoding.

Cheers

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2834</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2834</link>
				<pubDate><![CDATA[Mon, 24 Sep 2007 09:37:04]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ <p></p>

		<cite>marc wrote:</cite><br>
		<blockquote>Hi Alexey

It is not necessarily a problem with the import. It could be a problem with your display encoding.

Cheers

Marc&nbsp;
		</blockquote>
I've tried to enter data into MySQL manually with MySQL Query Browser and russian letters display ok.

I think it's the problem with MySQL or with import procedure.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2837</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2837</link>
				<pubDate><![CDATA[Mon, 24 Sep 2007 14:36:30]]> GMT</pubDate>
				<author><![CDATA[ Alexey]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ Still can't find solution. I tried to enter SET NAME... before importing, but still doesn't import correctly. Any ideas guys?]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2855</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2855</link>
				<pubDate><![CDATA[Sat, 29 Sep 2007 20:05:59]]> GMT</pubDate>
				<author><![CDATA[ Alexey]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ Hi Alexey,

just recently i had a similar problem and was able to solve it with the help of php's built in utf8decode() function before saving it to the mysql.
You might look as well after mysql_real_escape_string(). Just an idea.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2857</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2857</link>
				<pubDate><![CDATA[Sun, 30 Sep 2007 19:39:24]]> GMT</pubDate>
				<author><![CDATA[ auxburger]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ <p></p>

		<cite>auxburger wrote:</cite><br>
		<blockquote>Hi Alexey,

just recently i had a similar problem and was able to solve it with the help of php's built in utf8decode() function before saving it to the mysql.
You might look as well after mysql_real_escape_string(). Just an idea.&nbsp;
		</blockquote>
Thanks.

I do not use PHP here, PHP works fine with MySQL in UTF8 if I enter UTF8 data manually.

The problem is I can't import Geoname Alternatenames dump into MySQL. I get corrupted data. :(]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2858</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2858</link>
				<pubDate><![CDATA[Sun, 30 Sep 2007 20:18:31]]> GMT</pubDate>
				<author><![CDATA[ Alexey]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ Solved.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2861</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2861</link>
				<pubDate><![CDATA[Mon, 1 Oct 2007 12:15:54]]> GMT</pubDate>
				<author><![CDATA[ Alexey]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ Hi Alexey

I am glad you could solve the problem. If you think other GeoNames users could run  into the same problem then it would be great if you could post the solution.

Cheers

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2865</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2865</link>
				<pubDate><![CDATA[Mon, 1 Oct 2007 14:38:35]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Get problem when importing alternateNames table into MySQL</title>
				<description><![CDATA[ <p></p>

		<cite>marc wrote:</cite><br>
		<blockquote>Hi Alexey

I am glad you could solve the problem. If you think other GeoNames users could run  into the same problem then it would be great if you could post the solution.

Cheers

Marc&nbsp;
		</blockquote>
Sure Marc.

The problem was in MySQL settings. To make it work users should:

1. Create tables with UTF-8 character set and UTF-8 collation.

2. Set database setting to UTF-8 by this command:

<blockquote>ALTER DATABASE <i>databasename</i> charset=utf8;&nbsp;
		</blockquote>

3. Set MySQL settings to UTF-8 by adding these lines into MySQL configuration file (my.cnf for Linux, my.ini for Windows):

<blockquote>character_set_server=utf8
collation_server=utf8_general_ci&nbsp;
		</blockquote>

After this user should restart server.

That's it. :)

People can check settings by entering this command:

<blockquote>SHOW VARIABLES LIKE 'c%';&nbsp;
		</blockquote>

I really hope this will help, especially for people who doesn't know much about MySQL. ;)]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/615.page#2870</guid>
				<link>http://forum.geonames.org/gforum/posts/list/615.page#2870</link>
				<pubDate><![CDATA[Tue, 2 Oct 2007 11:39:38]]> GMT</pubDate>
				<author><![CDATA[ Alexey]]></author>
			</item>
	</channel>
</rss>