character set

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

character set

odoisneau-2
I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: character set

Guy Rouillier-2
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: character set

odoisneau-2
I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NpuoHe6HEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">odoi...@...
To: "mybatis-user" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="NpuoHe6HEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@...>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NpuoHe6HEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re[2]: character set

Guy Rouillier-2
Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

odoisneau-2
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <[hidden email]> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Tim
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

Tim
Are you saying that you are loading 2 different encodings in your migrations?
Can you load a sample project on github?

On Mon, Jan 15, 2018 at 7:06 PM, Olivier Doisneau <[hidden email]> wrote:
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <[hidden email]> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

odoisneau-2
CREATE TABLE IF NOT EXISTS `biller_mask` (
  `id` BIGINT UNSIGNED NOT NULL,
  `biller_id` BIGINT UNSIGNED NOT NULL,
  `mask` VARCHAR(40) CHARACTER SET 'latin1' NOT NULL,
  `mask_regexp` VARCHAR(1500) CHARACTER SET 'latin1' NOT NULL,
  `hint` VARCHAR(256) NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `zbiller_mask_zbiller_fk`
    FOREIGN KEY (`zbiller_id`)
    REFERENCES `zbiller` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

So this table is in a utf8 database using latin 1 for 2 columns.  This works from mysql command but not mybatis.

 
On Monday, January 15, 2018 at 8:41:16 PM UTC-5, h3adache wrote:
Are you saying that you are loading 2 different encodings in your migrations?
Can you load a sample project on github?

On Mon, Jan 15, 2018 at 7:06 PM, Olivier Doisneau <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="TyCBph6TEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">odoi...@...> wrote:
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="TyCBph6TEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">guy.ro...@...> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (<a href="https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java" style="font-size:12pt" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmybatis%2Fmigrations%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fibatis%2Fmigration%2FEnvironment.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLdBw45MmjodiA842MZxBwDJsjNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmybatis%2Fmigrations%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fibatis%2Fmigration%2FEnvironment.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLdBw45MmjodiA842MZxBwDJsjNw&#39;;return true;">https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="TyCBph6TEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">odoi...@...
To: "mybatis-user" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="TyCBph6TEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@...>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="TyCBph6TEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="TyCBph6TEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="TyCBph6TEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Tim
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

Tim
Not Mybatis Or MyBatis Migrations? Can you give the error msg?

On Mon, Jan 15, 2018 at 10:05 PM, <[hidden email]> wrote:
CREATE TABLE IF NOT EXISTS `biller_mask` (
  `id` BIGINT UNSIGNED NOT NULL,
  `biller_id` BIGINT UNSIGNED NOT NULL,
  `mask` VARCHAR(40) CHARACTER SET 'latin1' NOT NULL,
  `mask_regexp` VARCHAR(1500) CHARACTER SET 'latin1' NOT NULL,
  `hint` VARCHAR(256) NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `zbiller_mask_zbiller_fk`
    FOREIGN KEY (`zbiller_id`)
    REFERENCES `zbiller` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

So this table is in a utf8 database using latin 1 for 2 columns.  This works from mysql command but not mybatis.

 
On Monday, January 15, 2018 at 8:41:16 PM UTC-5, h3adache wrote:
Are you saying that you are loading 2 different encodings in your migrations?
Can you load a sample project on github?

On Mon, Jan 15, 2018 at 7:06 PM, Olivier Doisneau <[hidden email]> wrote:
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <[hidden email]> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

odoisneau-2
MyBatis migrations and the load is working fine but when I run a procedure to insert into the tabl eI get this error:

sqlstate:45000 msg:Incorrect string value: '\xC2\x91+.;>...'


On Monday, January 15, 2018 at 10:28:44 PM UTC-5, h3adache wrote:
Not Mybatis Or MyBatis Migrations? Can you give the error msg?

On Mon, Jan 15, 2018 at 10:05 PM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="pjOa5_uYEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">odoi...@...> wrote:
CREATE TABLE IF NOT EXISTS `biller_mask` (
  `id` BIGINT UNSIGNED NOT NULL,
  `biller_id` BIGINT UNSIGNED NOT NULL,
  `mask` VARCHAR(40) CHARACTER SET 'latin1' NOT NULL,
  `mask_regexp` VARCHAR(1500) CHARACTER SET 'latin1' NOT NULL,
  `hint` VARCHAR(256) NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `zbiller_mask_zbiller_fk`
    FOREIGN KEY (`zbiller_id`)
    REFERENCES `zbiller` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

So this table is in a utf8 database using latin 1 for 2 columns.  This works from mysql command but not mybatis.

 
On Monday, January 15, 2018 at 8:41:16 PM UTC-5, h3adache wrote:
Are you saying that you are loading 2 different encodings in your migrations?
Can you load a sample project on github?

On Mon, Jan 15, 2018 at 7:06 PM, Olivier Doisneau <[hidden email]> wrote:
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <[hidden email]> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (<a href="https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java" style="font-size:12pt" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmybatis%2Fmigrations%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fibatis%2Fmigration%2FEnvironment.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLdBw45MmjodiA842MZxBwDJsjNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmybatis%2Fmigrations%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fibatis%2Fmigration%2FEnvironment.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLdBw45MmjodiA842MZxBwDJsjNw&#39;;return true;">https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="pjOa5_uYEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

Erwan Letessier
Looks like something I have already met.
Actually when using MyBatis there is 1 more player: the jvm with file.encoding options which should be homogeneous with jdbc option then explicitly set to utf8 because it might not be the default.
Beyond that, I guess jdbc driver take care of encoding conversions so that application should not be impacted by database column encoding.


On Jan 16, 2018 10:41 AM, <[hidden email]> wrote:
MyBatis migrations and the load is working fine but when I run a procedure to insert into the tabl eI get this error:

sqlstate:45000 msg:Incorrect string value: '\xC2\x91+.;>...'


On Monday, January 15, 2018 at 10:28:44 PM UTC-5, h3adache wrote:
Not Mybatis Or MyBatis Migrations? Can you give the error msg?

On Mon, Jan 15, 2018 at 10:05 PM, <[hidden email]> wrote:
CREATE TABLE IF NOT EXISTS `biller_mask` (
  `id` BIGINT UNSIGNED NOT NULL,
  `biller_id` BIGINT UNSIGNED NOT NULL,
  `mask` VARCHAR(40) CHARACTER SET 'latin1' NOT NULL,
  `mask_regexp` VARCHAR(1500) CHARACTER SET 'latin1' NOT NULL,
  `hint` VARCHAR(256) NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `zbiller_mask_zbiller_fk`
    FOREIGN KEY (`zbiller_id`)
    REFERENCES `zbiller` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

So this table is in a utf8 database using latin 1 for 2 columns.  This works from mysql command but not mybatis.

 
On Monday, January 15, 2018 at 8:41:16 PM UTC-5, h3adache wrote:
Are you saying that you are loading 2 different encodings in your migrations?
Can you load a sample project on github?

On Mon, Jan 15, 2018 at 7:06 PM, Olivier Doisneau <[hidden email]> wrote:
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <[hidden email]> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

odoisneau-2
so I am finding that this:   
'[A-Z0-9!$‘+.;>`}“%(),/<?{~!#&*-:=_|@]');  
shows up as this: 
'[A-Z0-9!$��+.;>`}��%(),/<?{~!#&*-:=_|@]'); 

in sequel pro and interestingly when I run it from the command line I cannot open it in sequel pro cause of a permission error.  Hoping that helps someone debug my issue.



On Monday, January 15, 2018 at 11:46:27 PM UTC-5, Erwan Letessier wrote:
Looks like something I have already met.
Actually when using MyBatis there is 1 more player: the jvm with file.encoding options which should be homogeneous with jdbc option then explicitly set to utf8 because it might not be the default.
Beyond that, I guess jdbc driver take care of encoding conversions so that application should not be impacted by database column encoding.


On Jan 16, 2018 10:41 AM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="NTMTvTmdEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">odoi...@...> wrote:
MyBatis migrations and the load is working fine but when I run a procedure to insert into the tabl eI get this error:

sqlstate:45000 msg:Incorrect string value: '\xC2\x91+.;>...'


On Monday, January 15, 2018 at 10:28:44 PM UTC-5, h3adache wrote:
Not Mybatis Or MyBatis Migrations? Can you give the error msg?

On Mon, Jan 15, 2018 at 10:05 PM, <[hidden email]> wrote:
CREATE TABLE IF NOT EXISTS `biller_mask` (
  `id` BIGINT UNSIGNED NOT NULL,
  `biller_id` BIGINT UNSIGNED NOT NULL,
  `mask` VARCHAR(40) CHARACTER SET 'latin1' NOT NULL,
  `mask_regexp` VARCHAR(1500) CHARACTER SET 'latin1' NOT NULL,
  `hint` VARCHAR(256) NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `zbiller_mask_zbiller_fk`
    FOREIGN KEY (`zbiller_id`)
    REFERENCES `zbiller` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

So this table is in a utf8 database using latin 1 for 2 columns.  This works from mysql command but not mybatis.

 
On Monday, January 15, 2018 at 8:41:16 PM UTC-5, h3adache wrote:
Are you saying that you are loading 2 different encodings in your migrations?
Can you load a sample project on github?

On Mon, Jan 15, 2018 at 7:06 PM, Olivier Doisneau <[hidden email]> wrote:
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <[hidden email]> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (<a href="https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java" style="font-size:12pt" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmybatis%2Fmigrations%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fibatis%2Fmigration%2FEnvironment.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLdBw45MmjodiA842MZxBwDJsjNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmybatis%2Fmigrations%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fibatis%2Fmigration%2FEnvironment.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLdBw45MmjodiA842MZxBwDJsjNw&#39;;return true;">https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NTMTvTmdEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

Iwao AVE!

Hi Olivier,

It seems that script_char_set does not match the actual encoding used to save your migration script.

I did the following test and it worked fine.
Here is the table definition.

CREATE TABLE IF NOT EXISTS `biller_mask` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
  `mask` VARCHAR(256) CHARACTER SET 'latin1' NOT NULL,
  `hint` VARCHAR(256) NULL,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB;

The migration script contains the following INSERT and is saved with UTF-8 encoding.

insert into biller_mask (mask, hint) values ('[A-Z0-9!$‘+.;>`}“%(),/<?{~!#&*-:=_|@]', '[A-Z0-9!$‘+.;>`}“%(),/<?{~!#&*-:=_|@]');

And in the environment properties file:

url=jdbc:mysql://127.0.0.1/test?characterEncoding=UTF8
script_char_set=utf-8

migrate up succeeds and the inserted data shows up correctly on Sequel Pro.

埋め込み画像 1

Here is the result of show variables like '%character_set_%';

character_set_client    utf8mb4
character_set_connection    utf8mb4
character_set_database    utf8mb4
character_set_filesystem    binary
character_set_results    utf8mb4
character_set_server    utf8mb4
character_set_system    utf8

MySQL 5.6.38 / Connector/J 5.1.45.
MyBatis Migrations 3.3.1 / Java 1.8.0_131

If it still does not work, please post an example script and related information so that we can reproduce the problem.

Regards,
Iwao


2018-01-16 22:30 GMT+09:00 <[hidden email]>:
so I am finding that this:   
'[A-Z0-9!$‘+.;>`}“%(),/<?{~!#&*-:=_|@]');  
shows up as this: 
'[A-Z0-9!$��+.;>`}��%(),/<?{~!#&*-:=_|@]'); 

in sequel pro and interestingly when I run it from the command line I cannot open it in sequel pro cause of a permission error.  Hoping that helps someone debug my issue.



On Monday, January 15, 2018 at 11:46:27 PM UTC-5, Erwan Letessier wrote:
Looks like something I have already met.
Actually when using MyBatis there is 1 more player: the jvm with file.encoding options which should be homogeneous with jdbc option then explicitly set to utf8 because it might not be the default.
Beyond that, I guess jdbc driver take care of encoding conversions so that application should not be impacted by database column encoding.


On Jan 16, 2018 10:41 AM, <[hidden email]> wrote:
MyBatis migrations and the load is working fine but when I run a procedure to insert into the tabl eI get this error:

sqlstate:45000 msg:Incorrect string value: '\xC2\x91+.;>...'


On Monday, January 15, 2018 at 10:28:44 PM UTC-5, h3adache wrote:
Not Mybatis Or MyBatis Migrations? Can you give the error msg?

On Mon, Jan 15, 2018 at 10:05 PM, <[hidden email]> wrote:
CREATE TABLE IF NOT EXISTS `biller_mask` (
  `id` BIGINT UNSIGNED NOT NULL,
  `biller_id` BIGINT UNSIGNED NOT NULL,
  `mask` VARCHAR(40) CHARACTER SET 'latin1' NOT NULL,
  `mask_regexp` VARCHAR(1500) CHARACTER SET 'latin1' NOT NULL,
  `hint` VARCHAR(256) NULL,
  PRIMARY KEY (`id`),
  CONSTRAINT `zbiller_mask_zbiller_fk`
    FOREIGN KEY (`zbiller_id`)
    REFERENCES `zbiller` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

So this table is in a utf8 database using latin 1 for 2 columns.  This works from mysql command but not mybatis.

 
On Monday, January 15, 2018 at 8:41:16 PM UTC-5, h3adache wrote:
Are you saying that you are loading 2 different encodings in your migrations?
Can you load a sample project on github?

On Mon, Jan 15, 2018 at 7:06 PM, Olivier Doisneau <[hidden email]> wrote:
Yes I did try it. It is just frustrating cause MySQL from command line should work the same as a Jdbc connection I would think 

On Jan 15, 2018, at 7:03 PM, Guy Rouillier <[hidden email]> wrote:

Sorry, I didn't see the part where you mentioned you were using MyBatis Migrations. I haven't used it, so hopefully someone else who is knowledgeable about it will jump in.  

I took a quick look, and I see in the source (https://github.com/mybatis/migrations/blob/master/src/main/java/org/apache/ibatis/migration/Environment.java) an environment setting "script_char_set".  You might try that and see what it does; may not have anything at all to do with the charset of the database.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 5:54:59 PM
Subject: Re: character set

I must be using an older version of mybatis or something.  I use a file under the environment directory and I don't see xml files anywhere . I want a tool that manages which sql has been applied to which env. and the ability to go up and down as needed.

On Monday, January 15, 2018 at 5:16:13 PM UTC-5, Guy Rouillier wrote:
See the MyBatis User's Guide PDF.  In the dataSource section, you'll find the following:

"Optionally, you can pass properties to the database driver as well. To do this, prefix the properties
with driver., for example:

• driver.encoding=UTF8

This will pass the property encoding, with the value UTF8, to your database driver via the
DriverManager.getConnection(url, driverProperties) method.

--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 1/15/2018 2:40:09 PM
Subject: character set

I have a mysql database with multiple character sets.  When I upload data using mysql client it works fine but when I use mybatis migration to load data, it fails.  how do I make mybatis use the same character set as mysql.  Right now my jdbc says: 

useSSL=false&useUnicode=yes&characterEncoding=utf8 at the end.


Any input would be very helpful because some of the data is utf8 and other is latin1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/RNoUNwdFW7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]om.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: character set

odoisneau-2
thank you everyone for your help.  It turned out that when I got the sql it included left single quote and left double quote and so I believe that is why I had issues with the mybatis migrate scripts.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.