mysql and utf8

2006-01-22 Thread devy
Hi list,

I'm having some problems while trying to save into a TEXT field some data
containing text and special characters from a C program!
I thought to convert the special characters with UTF8 but I don't know how
to write the SQL-query to insert data in the following table:

CREATE TABLE `books`
(
  `id` int(11) NOT NULL auto_increment,
  `txt` text character set latin1 NOT NULL,
   PRIMARY KEY  (`id`),
   FULLTEXT KEY `txt` (`txt`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC

this because I should convert all characters to utf8 and I would convert
only the special one! For example I would like to do:
INSERT INTO books (txt) VALUES('exa \xC3\xAE mple');

but this will result in: exa xC3xAE mple!

I know that I can do:
INSERT INTO books (txt) VALUES(concat('exa', convert(0xC3AE using utf8)
,'mple'));
but I need a way to write this query without the use of concat (like the
first example) by converting special characters in a format understood by
mysql as UTF8 and preserving the others characters!
Is there a way?

Thanks,
Devy


Unable to initialise database

2006-01-22 Thread Jon Miller
Having a problem connecting to a MySQL database from a mail server.  In the 
mail logs I'm getting:
mail MailScanner[4904]: Unable to initialise database connection: Can't connect 
to MySQL server on '192.168.10.4' (110)

In the script that is running it has a mysql_connect statement with the correct 
credentials.  From the command line of the mail server I can issue the command 
# MySQL -u mailwatch -h 192.168.10.4 mailscanner -p 
then I give it the password  after which I have a MySQL prompt.
I have in the database the user name with GRANT privileges on both local host 
and the mail server.

So I'm trying to figure out why it does not work from within the script.  I 
think it may have to do with the DBI connector.
Tried the following but getting errors

#!/usr/bin/perl

use DBI

$host = '192.168.10.4';
$port = '3306';

$dbh = DBI-connect (DBI:mysql:mailscanner; mailwatch, mailwatch);

if ($dbh) {print Connection successful! \n }

error message:
DBI version 192.168.10.4 required--this is only version 1.46 at 
/usr/share/perl/5.8/Exporter/Heavy.pm line 107.
BEGIN failed--compilation aborted at ./dbi.pl line 5.


Any ideas?

Jon


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: question about recovery with binlog

2006-01-22 Thread wangxu
How to replace it?

The output is a binary file.
- Original Message - 
From: Gleb Paharenko [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, January 20, 2006 10:11 PM
Subject: Re: question about recovery with binlog


 Hello.
 
 Just a possible workaround - you can parse the output of mysqlbinlog and
 replace the buggy statement with the correct one.
 
 
 wangxu wrote:
  My mysql version is 5.0.16.
  
  My problem is similar to the bug.
  
  My sql mode is ANSI and TRADITIONAL
  
  If mysql can't do recovery with mysqlbinlog at my sql mode  until the bug 
  will be fixed?
  
  Follow is the information of my binlog.
  
  --
  /*!40019 SET @@session.max_insert_delayed_threads=0*/;
  /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
  # at 4
  #060119 13:55:30 server id 1  end_log_pos 98Start: binlog v 4, server v 
  5.0.16-standard-log created 060119 13:55:30
  # Warning: this binlog was not closed properly. Most probably mysqld 
  crashed writing it.
  # at 98
  #060119 13:57:41 server id 1  end_log_pos 165   Query   thread_id=4 
  exec_time=0 error_code=0
  use wangxu;
  SET TIMESTAMP=1137650261;
  SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, 
  @@session.unique_checks=1;
  SET @@session.sql_mode=501481487;
  SET 
  @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33;
  insert ht_detail 
  values('79NK0006','79NK0006',1),('79NK0007','79NK0007',1),('79NK0008','79NK0008',1);
  # at 263
  #060119 13:57:41 server id 1  end_log_pos 290   Xid = 215
  COMMIT;
  # at 290
  #060119 14:08:30 server id 1  end_log_pos 445   Query   thread_id=7 
  exec_time=0 error_code=0
  SET TIMESTAMP=1137650910;
  SET @@session.foreign_key_checks=0, @@session.unique_checks=0;
  SET @@session.sql_mode=524288;
  CREATE DATABASE /*!32312 IF NOT EXISTS*/ `wangxu` /*!40100 DEFAULT 
  CHARACTER SET latin1 */;
  # at 445
  #060119 14:08:30 server id 1  end_log_pos 542   Query   thread_id=7 
  exec_time=0 error_code=0
  SET TIMESTAMP=1137650910;
  DROP TABLE IF EXISTS `ht_detail`;
  # at 542
  #060119 14:08:40 server id 1  end_log_pos 639   Query   thread_id=8 
  exec_time=0 error_code=0
  SET TIMESTAMP=1137650920;
  DROP TABLE IF EXISTS `ht_detail`;
  # at 639
  #060119 14:23:13 server id 1  end_log_pos 733   Query   thread_id=11
  exec_time=0 error_code=0
  SET TIMESTAMP=1137651793;
  SET @@session.foreign_key_checks=1, @@session.unique_checks=1;
  SET @@session.sql_mode=501481487;
  create table ht_header(a int);
  # at 733
  #060119 14:23:53 server id 1  end_log_pos 818   Query   thread_id=12
  exec_time=0 error_code=0
  SET TIMESTAMP=1137651833;
  drop table ht_header;
  # at 818
  #060119 14:28:10 server id 1  end_log_pos 915   Query   thread_id=15
  exec_time=0 error_code=0
  SET TIMESTAMP=1137652090;
  SET @@session.foreign_key_checks=0, @@session.unique_checks=0;
  SET @@session.sql_mode=524288;
  DROP TABLE IF EXISTS `ht_detail`;
  # at 915
  #060119 14:29:44 server id 1  end_log_pos 998   Query   thread_id=16
  exec_time=0 error_code=0
  use test;
  SET TIMESTAMP=1137652184;
  SET @@session.foreign_key_checks=1, @@session.unique_checks=1;
  SET @@session.sql_mode=501481487;
  drop table ht_detail;
  # at 998
  #060119 14:30:29 server id 1  end_log_pos 1160  Query   thread_id=16
  exec_time=0 error_code=0
  SET TIMESTAMP=1137652229;
  create table ht_detail(hth varchar(30),sbh varchar(15),sbsl int,primary 
  key(hth,sbh)) type = innodb;
  # at 1160
  #060119 14:54:50 server id 1  end_log_pos 1243  Query   thread_id=20
  exec_time=0 error_code=0
  SET TIMESTAMP=1137653690;
  drop schema wangxu;
  # at 1243
  #060119 14:54:57 server id 1  end_log_pos 1328  Query   thread_id=20
  exec_time=0 error_code=0
  SET TIMESTAMP=1137653697;
  create schema wangxu;
  # at 1328
  #060119 14:55:17 server id 1  end_log_pos 1422  Query   thread_id=20
  exec_time=0 error_code=0
  use wangxu;
  SET TIMESTAMP=1137653717;
  create table ht_detail(a int);
  # at 1422
  #060119 17:10:13 server id 1  end_log_pos 1505  Query   thread_id=24
  exec_time=0 error_code=0
  SET TIMESTAMP=1137661813;
  drop schema wangxu;
  # at 1505
  #060119 17:10:17 server id 1  end_log_pos 1590  Query   thread_id=24
  exec_time=0 error_code=0
  SET TIMESTAMP=1137661817;
  create schema wangxu;
  # at 1590
  #060119 17:10:47 server id 1  end_log_pos 1687  Query   thread_id=25
  exec_time=0 error_code=0
  SET TIMESTAMP=1137661847;
  SET @@session.foreign_key_checks=0, @@session.unique_checks=0;
  SET @@session.sql_mode=524288;
  DROP TABLE IF EXISTS `ht_detail`;
  # at 1687
  #060119 17:10:47 server id 1  end_log_pos 1959  Query   thread_id=25
  exec_time=0 error_code=0
  SET TIMESTAMP=1137661847;
  CREATE TABLE `ht_detail` (
`hth` varchar(30) NOT NULL 

Re: upgrade advice

2006-01-22 Thread Colin Charles

Jon Miller wrote:

Jon,


I'm currently running MySQL on RedHat 7.2 and now I'm in the processing of 
finishing testing a new server which has SUSE Linux Enterprise Server 9.
My question is my database currently resides on RH7.2 and 
MySQL-server-4.0.13-0.  I want to install the latest version on the SUSE system 
but I believe this to be  Version: 4.0.18 Release: 32.20 (this is with Service 
Pack 3 from Novell).
How do I do a backup of the existing and restore to the current? Are there any 
changes that may cause my apps to have a fit?


Seeing that you're moving from 4.0.x to a 4.0.x, its highly unlikely 
that any of yours apps should have a fit.


You might fancy reading: 
http://dev.mysql.com/doc/refman/5.0/en/disaster-prevention.html (our 
backup and recovery guide)


If you fancy performing an upgrade to a newer version, do pay 
http://dev.mysql.com/doc/refman/4.1/en/upgrade.html a visit as well.


Hope this helps
--
Colin Charles, Community Engineer
MySQL AB, Kuala Lumpur, Malaysia, www.mysql.com
Office: [EMAIL PROTECTED] / +46 18 174 400 ext. 4528

Are you MySQL certified? www.mysql.com/certification

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Can not get answers

2006-01-22 Thread wangxu
I can not recieve answer about follow url for a long time.

I very need the answers of those.

Please help me. thanks!

  http://forums.mysql.com/read.php?34,61375,61375#msg-61375

  http://forums.mysql.com/read.php?34,61374,61374#msg-61374

  http://forums.mysql.com/read.php?34,60411,60411#msg-60411