weird mysql problem on linux, international chars truncates varchar
Posted by: Daniel W
Date: August 19, 2006 07:49AM

Hello guys and gals!

database: remote gentoo server, mysql 5.0.22

I logged in to the server via ssh, and with the mysql command line tool I created a new database with one table and executed some INSERT statements from the mysql command line. After that i did SELECT on the new data, but a strange thing happened, all varchars got truncated by the first occurence of a special char.

So it clearly is a database issue.
Now, how do you solve it?

I have seen that in many other posts concerning character encoding etc. you usually need the output of some commands, here we go:


Server:

mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

And the new database table that I created:
mysql> show create table tost;
+-------+---------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------+
| tost | CREATE TABLE `tost` (
`col` varchar(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
+-------+---------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

And from my local computer where everything works:

mysql> show variables like 'char%';
+--------------------------+---------------------------------------------------+

| Variable_name | Value |

+--------------------------+---------------------------------------------------+

| character_set_client | latin1 |

| character_set_connection | latin1 |

| character_set_database | latin1 |

| character_set_results | latin1 |

| character_set_server | latin1 |

| character_set_system | utf8 |

| character_sets_dir | C:\Program\MySQL\MySQL Server 5.0\share\charsets\ |

+--------------------------+---------------------------------------------------+

7 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
weird mysql problem on linux, international chars truncates varchar
2713
August 19, 2006 07:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.