title: How to bypass invalid utf8 character string in mysql
body: <p>I have a large text file containing Arabic text data. When I try to load it into a MySQL table, I get error saying <code>Error code 1300: invalid utf8 character string</code>. This is what I have tried so far:</p>
  
  <pre><code>LOAD DATA INFILE '/var/lib/mysql-files/text_file.txt'
  IGNORE INTO TABLE tblTest
  FIELDS TERMINATED BY '\t'
  LINES TERMINATED BY '\n';
  </code></pre>
  
  <p>I tried to ignore this error, but it does not work. I have tried <code>LOCAL INFILE</code> but it did not work, too. My database was created using <code>DEFAULT CHAR SET UTF8</code> and <code>DEFAULT COLLATE utf8_general_ci</code>. The text file is <code>utf-8</code> encoded.</p>
  
  <p>I do not want the records which contain invalid utf8 characters. So how I can load the data with ignoring the records containing such invalid chars?</p>
  
  <p>Thank in advance!</p>