Category Archives: database

MySQL LOAD DATA INFILE Syntax for Importing from CSV file.

The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. LOAD DATA INFILE is the complement of SELECT … INTO OUTFILE. To write data from a table to a file, use SELECT … INTO OUTFILE. To read the file back into a table, use LOAD DATA INFILE. The syntax of the FIELDS and LINES clauses is the same for both statements. Both clauses are optional, but FIELDS must precede LINES if both are specified.


For a sucessful operation, The fields count in the CSV file should match with the column count of the table. Otherwise your operation result will be Invalid/Erroneous. Also path to the CSV file should be correctly specified.

MySQL Database Find and Replace Field Text Query Syntax

Hey there,

You might have stopped while working with applications where you wanted to find some specific string values from the database & replace with another value. This can be easily achieved within the MySQL database. The syntax for FIND & REPLACE operation on MySQL database as follows.

yourTableName is the name of the Database Table.

YourFieldName is the Field name corresponds to the Database Table yourTableName.

stringToFind is the String to find from the field value.

stringToReplace is the string to be replaced for the existing stringToFind string.

For eg.

Let’s say YourFieldName value as Name is a very Good boy. Name is very intelligent also. You can’t see any boy like Name..;)

And if you want to replace Name with Jax try the following query.

After the query execution, New YourFieldName value will be

Jax is a very Good boy. Jax is very intelligent also. You can’t see any boy like Jax ..;)

That’s it..Share this..Cheers..:)