Posts tagged with ‘mysql’

Maximum length for MySQL TEXT field types

advertisement

mysqlJust gone thru the maximum length limit for different MySQL TEXT field types. I’m designing a table to store large amount of data within a field. To avoid data being truncated automatically, it’s good to know the maximum length limit for different MySQL TEXT field types.

Here’s the summary for maximum length limit for different MySQL TEXT field types:

Continue reading Maximum length for MySQL TEXT field types »

How to import mysql innodb with foreign key constraint error?

advertisement

mysql, mysql dbTried to import a mysql innodb from a sql dump file, but it keep show me there is an foreign key constraint error. Due to innodb has foreign key check validation, it does not allow me to continue n show me foreign key constraint error. Ya! I know my data having some foreign key constraint problem, but what i need to do now is to import my sql dump file!

Here’s the error message “#1452 – Cannot add or update a child row: a foreign key constraint fails…”

After going thru the mysql documentation, finally i found the solution! This solution not only allow me to import my innodb, but also improve the import speed tremendously!

To import mysql innodb with foreign key constraint error, follow the steps below:-

Continue reading How to import mysql innodb with foreign key constraint error? »

How to do string replace (str_replace) in MySQL

advertisement

mysqlMySQL has a built in function to perform string replace (just like PHP str_replace) thru the query. I just perform a MySQL string replace at a website migration and everything work like a charm. This MySQL string replace function really save me a lot of time! Imagine if i’m going to edit the record one by one, and there is 100 record, i think i’m going to be crazy after the manual edition.

To perform string replace (str_replace) in MySQL, you can use the query below:-

Continue reading How to do string replace (str_replace) in MySQL »