Importing MS SQL exported CSV files adds spaces

2008-11-03 Thread Ali, Saqib
I exported a large data set from from Microsoft SQL server in CSV
format. However whenever I try to import that data to a a mySQL server
running on Linux, it adds a space between each character in each
field.

Essentially:
Saqib Ali
becomes
S a q i b  A l i

I have tried to use the dos2unix cmd on linux, but that didn't help either.

I am using the following SQL to import the data:
LOAD DATA LOCAL INFILE '/home/saqib/data.csv' INTO TABLE apps FIELDS
TERMINATED BY ',' ENCLOSED BY ''   LINES TERMINATED BY '\n';


Any thoughts?


saqib
http://doctrina.wordpress.com/

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



InnoDB table space errors

2008-11-03 Thread Marten Lehmann
How can I remove a table space from the internal data dictionary? The 
documentation doesn't help at all.


Even after a fresh installation and importing all dumps of the databases 
from scratch, I get these errors:



Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x453d60e0, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
(nil)
New value of fp=0x1be63920 failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/using-stack-trace.html and 
follow instructions on how to resolve the stack trace. Resolved

stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd-query at 0x2aaae00bcd40  is invalid pointer
thd-thread_id=9694
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

Number of processes running now: 0
081103 19:47:13  mysqld restarted
InnoDB: Log scan progressed past the checkpoint lsn 0 2529773664
081103 19:47:13  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 0 2529774316
081103 19:47:22  InnoDB: Error: table 'db20255/tbl_film_categories'
InnoDB: in InnoDB data dictionary has tablespace id 2365,
InnoDB: but tablespace with that id or name does not exist. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: This may also be a table created with CREATE TEMPORARY TABLE
InnoDB: whose .ibd and .frm files MySQL automatically removed, but the
InnoDB: table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
InnoDB: for how to resolve the issue.
081103 19:47:22  InnoDB: Starting an apply batch of log records to the 
database...
InnoDB: Progress in percents: 23 24 25 26 27 28 29 30 31 32 33 34 35 36 
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

InnoDB: Apply batch completed
081103 19:47:23  InnoDB: Started; log sequence number 0 2529774316
081103 19:47:24 [Note] /vrmd/mysql/mysql-5.0.67/libexec/mysqld: ready 
for connections.
Version: '5.0.67-log'  socket: '/tmp/mysql.sock'  port: 3306  Source 
distribution


Regards
Marten

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



Re: Importing MS SQL exported CSV files adds spaces

2008-11-03 Thread Ali, Saqib
 try OPTIONALLY ENCLOSED BY '  '

already tried that. no help :(

saqib
http://doctrina.wordpress.com/

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



Re: Importing MS SQL exported CSV files adds spaces

2008-11-03 Thread Grant Allen

Ali, Saqib wrote:

I exported a large data set from from Microsoft SQL server in CSV
format. However whenever I try to import that data to a a mySQL server
running on Linux, it adds a space between each character in each
field.

Essentially:
Saqib Ali
becomes
S a q i b  A l i

I have tried to use the dos2unix cmd on linux, but that didn't help either.

I am using the following SQL to import the data:
LOAD DATA LOCAL INFILE '/home/saqib/data.csv' INTO TABLE apps FIELDS
TERMINATED BY ',' ENCLOSED BY ''   LINES TERMINATED BY '\n';



You SQL Server export will be Unicode, UTF8 or UTF16 ... thus the 
appearance of the extra spaces.  (That's just coincidence, they're not 
really extra spaces ... the text editor you're viewing the file with is 
treating the data as ASCII, and not recognising the multi-byte nature of 
the characters.)


Change your MySQL character set for the apps table appropriately (i.e. 
make it match the character set of the data), and see what happens.  
Alternatively, create a staging table with the right character set to 
load the data into first, and then convert it using an insert ... 
cast... style statement into your apps table (basic ETL).


Ciao
Fuzzy
:-)


Dazed and confused about technology for 20 years
http://fuzzydata.wordpress.com/


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



Error: Got error 139 from storage engine

2008-11-03 Thread Jesse
I have an ASP.net web application running on a WS03 server using MySQL 
5.0.67-community-nt-log.


I have a form that allows the customer to use a visual HTML editor to input 
text that will appear on a web page.  So, the text contains HTML tags.  When 
it tries to save the text to the table in the database, I get the error, 
#HY000Got error 139 from storage engine. Does anyone know what this is and 
how to fix it?


Thanks,
Jesse 



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



Re: How to understand this phrase on the document.

2008-11-03 Thread Moon's Father
Thanks for your patient reply.
   Now I believe that the memory leak problem was generated by the program.

On Sat, Nov 1, 2008 at 5:31 PM, Ian Christian [EMAIL PROTECTED] wrote:

 2008/10/31 Moon's Father [EMAIL PROTECTED]

 *A prepared statement is also global to the connection. If you create a
 prepared statement within a stored routine, it is not deallocated when the
 stored routine ends. *

 Then I don't know how to deallocate the memory used by prepare statement
 within procedure?


 The memory will be de-allocated when you disconnect that session, there is
 no need to worry about it's memory usage.

 This statement simply means that if you call a method twice, which uses the
 same prepared statement, it will on need to be re-prepared, and hence you
 will see an improvement in speed.




-- 
I'm a MySQL DBA in china.
More about me just visit here:
http://yueliangdao0608.cublog.cn


Re: Error: Got error 139 from storage engine

2008-11-03 Thread Thomas Spahni
On Mon, 3 Nov 2008, Jesse wrote:

 I have an ASP.net web application running on a WS03 server using MySQL
 5.0.67-community-nt-log.
 
 I have a form that allows the customer to use a visual HTML editor to input
 text that will appear on a web page.  So, the text contains HTML tags.  When
 it tries to save the text to the table in the database, I get the error,
 #HY000Got error 139 from storage engine. Does anyone know what this is and
 how to fix it?

prompt perror 139
MySQL error code 139: Too big row

Seems you are exceeding some limit.

Regards,
Thomas

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