Re: 答复: PreparedStatement problem
- Original Message - From: ZhangFangXue zhangfang...@sogou-inc.com well, the problem is that I used it like this: prep_stmt = con - prepareStatement (INSERT INTO City (CityNumber) The statement in your original mail used CityName, which sounds like it should be a string. Fieldname confusion? -- Unhappiness is discouraged and will be corrected with kitten pictures. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: PreparedStatement problem
- Original Message - From: ZhangFangXue zhangfang...@sogou-inc.com Hi, when I use PreparedStatement in c++ connector, I find some unexcepted error, Well, first of all, you don't actually say what the error is that you're seeing. This tends to be on the rather helpful side when trying to diagnose it. prep_stmt = con - prepareStatement (INSERT INTO City (CityName) VALUES (?)); prep_stmt - setInt (1, 23); //this statement didn't act normally!!! However, if you're inserting into a text field, it may well be that the parser will balk at you trying to bind an integer to that, no? If you want to insert a string, it's fairly common practice to provide an actual string to insert. Quite the novel idea, I know. -- Unhappiness is discouraged and will be corrected with kitten pictures. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
答复: PreparedStatement problem
well, the problem is that I used it like this: prep_stmt = con - prepareStatement (INSERT INTO City (CityNumber) VALUES (?)); prep_stmt - setInt (1, 23); //this statement didn’t act normally!!! then when I execute the statement, the result does not appear to be correct, as CityNumber is not 23, I am sure that the field is integer. I guess that something about number is not well delt in the PreparedStatement class. If I use setString(1, 23), the result is correct!! thank you for your response! -邮件原件- 发件人: Johan De Meersman [mailto:vegiv...@tuxera.be] 发送时间: 2013年2月19日 16:12 收件人: ZhangFangXue 抄送: mysql@lists.mysql.com 主题: Re: PreparedStatement problem - Original Message - From: ZhangFangXue zhangfang...@sogou-inc.com Hi, when I use PreparedStatement in c++ connector, I find some unexcepted error, Well, first of all, you don't actually say what the error is that you're seeing. This tends to be on the rather helpful side when trying to diagnose it. prep_stmt = con - prepareStatement (INSERT INTO City (CityName) VALUES (?)); prep_stmt - setInt (1, 23); //this statement didn't act normally!!! However, if you're inserting into a text field, it may well be that the parser will balk at you trying to bind an integer to that, no? If you want to insert a string, it's fairly common practice to provide an actual string to insert. Quite the novel idea, I know. -- Unhappiness is discouraged and will be corrected with kitten pictures.
答复: 答复: PreparedStatement problem
yes, it is CityName, but it is not the point, setInt works abnormally.. By the way, I found there is not a thorough introduction to the mysql c++ connector, can you give me some hint? -邮件原件- 发件人: Johan De Meersman [mailto:vegiv...@tuxera.be] 发送时间: 2013年2月19日 16:36 收件人: ZhangFangXue 抄送: mysql@lists.mysql.com 主题: Re: 答复: PreparedStatement problem - Original Message - From: ZhangFangXue zhangfang...@sogou-inc.com well, the problem is that I used it like this: prep_stmt = con - prepareStatement (INSERT INTO City (CityNumber) The statement in your original mail used CityName, which sounds like it should be a string. Fieldname confusion? -- Unhappiness is discouraged and will be corrected with kitten pictures.
Re: How to verify if backup is ok?
Thanks for the reply. pt-table-checksum performs an online replication consistency check by executing checksum queries on the master, which produces different results on replicas that are inconsistent with the master. - It should be used for verifing mysql replication, not for my problem. Any other tips? Best regards, Rafal Radecki. 2013/2/18 Johan De Meersman vegiv...@tuxera.be: - Original Message - From: Rafał Radecki radecki.ra...@gmail.com 3) drop mysql and app databases; 4) restore them from backup; Instead of dropping the DBs, simply restore to another database or server. That will also allow you to perform a comparison using some graphical tool, or if that fails mysqldumps and diff. tips? Should I do it on filesystem level or on mysql level? Are there any external tools? Filesystem level won't work, as it's fairly unlikely that the records will have been written in the same order - let alone that you won't have delete gaps etc. Percona toolkit has tools to verify master/slave setups (pt-table-compare, I believe), I suppose they would also work on non-replicated setups. -- Unhappiness is discouraged and will be corrected with kitten pictures. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: How to verify if backup is ok?
Thanks, I will use this tool :) 2013/2/19 Johan De Meersman vegiv...@tuxera.be: - Original Message - From: Rafał Radecki radecki.ra...@gmail.com pt-table-checksum performs an online replication consistency check by executing checksum queries on the master, which produces different results on replicas that are inconsistent with the master. - It should be used for verifing mysql replication, not for my problem. Hmm, I didn't realise that that was not a part of pt-table-checksum. The older mk-table-checksum from Maatkit doesn't particularly care about masters and slaves, and will happily compare to unrelated databases. You can still find it at http://www.maatkit.org/doc/mk-table-checksum.html#description . I just copied the contents of a db to another db on the same server, and it works as advertised. Not the first feature that I noticed hasn't been merged into the PT suite :-( -- Unhappiness is discouraged and will be corrected with kitten pictures. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: How to verify if backup is ok?
- Original Message - From: Rafał Radecki radecki.ra...@gmail.com pt-table-checksum performs an online replication consistency check by executing checksum queries on the master, which produces different results on replicas that are inconsistent with the master. - It should be used for verifing mysql replication, not for my problem. Hmm, I didn't realise that that was not a part of pt-table-checksum. The older mk-table-checksum from Maatkit doesn't particularly care about masters and slaves, and will happily compare to unrelated databases. You can still find it at http://www.maatkit.org/doc/mk-table-checksum.html#description . I just copied the contents of a db to another db on the same server, and it works as advertised. Not the first feature that I noticed hasn't been merged into the PT suite :-( -- Unhappiness is discouraged and will be corrected with kitten pictures. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: Upgrading form mysql 5.0.90 to 5.5 or 5.6
surely * use mysql_upgrade -u root -p after EACH update * upgrade regulary we went from MySQL 3.x to 5.5.30 until know without any dump and here are around 5000 tables Am 19.02.2013 22:12, schrieb Divesh Kamra: Is there any better way for grade MySQL version without taking backup with mysqldump Or if there any tool for this R's DK On 16-Feb-2013, at 16:07, Reindl Harald h.rei...@thelounge.net wrote: Am 16.02.2013 09:42, schrieb Manuel Arostegui: 2013/2/15 Reindl Harald h.rei...@thelounge.net mailto:h.rei...@thelounge.net our database is 400 GB, mysqldump is 600MB was not a typo and you honestly believed that you can import this dump to somewhat? WTF - as admin you should be able to see if the things in front of you are theoretically possible before your start any action and 1:400 is impossible, specially because mysql-dumps are ALWAYS WAY LARGER then the databasses because they contain sql-statements and not only data That's not completely true. If you have a poor maintained database or just tables with lot of writes and deletes and you don't periodically optimize it - you can end up with lot of blank spaces in your tables which will use _a lot_ of space. If you do a du or whatever to measure your database size...you can get really confused. mysqldump obviously doesn't backup blank spaces and once you get rid of them, your database will use much less space. ok, normally i expect there is a admin and doing his job especially for large datasets signature.asc Description: OpenPGP digital signature
Re: Upgrading form mysql 5.0.90 to 5.5 or 5.6
Use replication as your fail over and why not percona's xtrabackup or lvm type backup if you need a backup? Sabika On Feb 19, 2013, at 1:20 PM, Reindl Harald h.rei...@thelounge.net wrote: surely * use mysql_upgrade -u root -p after EACH update * upgrade regulary we went from MySQL 3.x to 5.5.30 until know without any dump and here are around 5000 tables Am 19.02.2013 22:12, schrieb Divesh Kamra: Is there any better way for grade MySQL version without taking backup with mysqldump Or if there any tool for this R's DK On 16-Feb-2013, at 16:07, Reindl Harald h.rei...@thelounge.net wrote: Am 16.02.2013 09:42, schrieb Manuel Arostegui: 2013/2/15 Reindl Harald h.rei...@thelounge.net mailto:h.rei...@thelounge.net our database is 400 GB, mysqldump is 600MB was not a typo and you honestly believed that you can import this dump to somewhat? WTF - as admin you should be able to see if the things in front of you are theoretically possible before your start any action and 1:400 is impossible, specially because mysql-dumps are ALWAYS WAY LARGER then the databasses because they contain sql-statements and not only data That's not completely true. If you have a poor maintained database or just tables with lot of writes and deletes and you don't periodically optimize it - you can end up with lot of blank spaces in your tables which will use _a lot_ of space. If you do a du or whatever to measure your database size...you can get really confused. mysqldump obviously doesn't backup blank spaces and once you get rid of them, your database will use much less space. ok, normally i expect there is a admin and doing his job especially for large datasets -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: Upgrading form mysql 5.0.90 to 5.5 or 5.6
Hi Reindi Thanks for solution . Can u share complete steps ? R's DK On 20-Feb-2013, at 2:50, Reindl Harald h.rei...@thelounge.net wrote: surely * use mysql_upgrade -u root -p after EACH update * upgrade regulary we went from MySQL 3.x to 5.5.30 until know without any dump and here are around 5000 tables Am 19.02.2013 22:12, schrieb Divesh Kamra: Is there any better way for grade MySQL version without taking backup with mysqldump Or if there any tool for this R's DK On 16-Feb-2013, at 16:07, Reindl Harald h.rei...@thelounge.net wrote: Am 16.02.2013 09:42, schrieb Manuel Arostegui: 2013/2/15 Reindl Harald h.rei...@thelounge.net mailto:h.rei...@thelounge.net our database is 400 GB, mysqldump is 600MB was not a typo and you honestly believed that you can import this dump to somewhat? WTF - as admin you should be able to see if the things in front of you are theoretically possible before your start any action and 1:400 is impossible, specially because mysql-dumps are ALWAYS WAY LARGER then the databasses because they contain sql-statements and not only data That's not completely true. If you have a poor maintained database or just tables with lot of writes and deletes and you don't periodically optimize it - you can end up with lot of blank spaces in your tables which will use _a lot_ of space. If you do a du or whatever to measure your database size...you can get really confused. mysqldump obviously doesn't backup blank spaces and once you get rid of them, your database will use much less space. ok, normally i expect there is a admin and doing his job especially for large datasets -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: Upgrading form mysql 5.0.90 to 5.5 or 5.6
Am 19.02.2013 23:53, schrieb Divesh Kamra: Hi Reindi Thanks for solution . Can u share complete steps ? which steps? * update * call mysql_upgrade -u root -p in doubt mysqlcheck -h localhost --check-upgrade --all-databases --auto-repair --user=root -p and if you do mysql_upgrade -u root -p and are always up-to-date that was it, no matter if you move your data from windows to MacOSX and finally to linux or whatever OS On 20-Feb-2013, at 2:50, Reindl Harald h.rei...@thelounge.net wrote: surely * use mysql_upgrade -u root -p after EACH update * upgrade regulary we went from MySQL 3.x to 5.5.30 until know without any dump and here are around 5000 tables Am 19.02.2013 22:12, schrieb Divesh Kamra: Is there any better way for grade MySQL version without taking backup with mysqldump Or if there any tool for this R's DK On 16-Feb-2013, at 16:07, Reindl Harald h.rei...@thelounge.net wrote: Am 16.02.2013 09:42, schrieb Manuel Arostegui: 2013/2/15 Reindl Harald h.rei...@thelounge.net mailto:h.rei...@thelounge.net our database is 400 GB, mysqldump is 600MB was not a typo and you honestly believed that you can import this dump to somewhat? WTF - as admin you should be able to see if the things in front of you are theoretically possible before your start any action and 1:400 is impossible, specially because mysql-dumps are ALWAYS WAY LARGER then the databasses because they contain sql-statements and not only data That's not completely true. If you have a poor maintained database or just tables with lot of writes and deletes and you don't periodically optimize it - you can end up with lot of blank spaces in your tables which will use _a lot_ of space. If you do a du or whatever to measure your database size...you can get really confused. mysqldump obviously doesn't backup blank spaces and once you get rid of them, your database will use much less space. ok, normally i expect there is a admin and doing his job especially for large datasets -- Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / CISO / Software-Development p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm signature.asc Description: OpenPGP digital signature
Re: Upgrading form mysql 5.0.90 to 5.5 or 5.6
Hi all Is there any better way for grade MySQL version without taking backup with mysqldump Or if there any tool for this R's DK On 16-Feb-2013, at 16:07, Reindl Harald h.rei...@thelounge.net wrote: Am 16.02.2013 09:42, schrieb Manuel Arostegui: 2013/2/15 Reindl Harald h.rei...@thelounge.net mailto:h.rei...@thelounge.net our database is 400 GB, mysqldump is 600MB was not a typo and you honestly believed that you can import this dump to somewhat? WTF - as admin you should be able to see if the things in front of you are theoretically possible before your start any action and 1:400 is impossible, specially because mysql-dumps are ALWAYS WAY LARGER then the databasses because they contain sql-statements and not only data That's not completely true. If you have a poor maintained database or just tables with lot of writes and deletes and you don't periodically optimize it - you can end up with lot of blank spaces in your tables which will use _a lot_ of space. If you do a du or whatever to measure your database size...you can get really confused. mysqldump obviously doesn't backup blank spaces and once you get rid of them, your database will use much less space. ok, normally i expect there is a admin and doing his job especially for large datasets -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql