Export and Import an Individual MySQL Table from command line

While moving databases from development to production and vice versa it is sometimes necessary to export individual tables so that they can be imported into another database.

So in this post i will show you how to export and import individual MySQL Table

Export a single MySQL table


mysqldump -u username root -p dbname tablename > d:\tablename.sql


Import a previously dumped MySQL table



mysql -u username -p PASSWORD_HERE -D dbname < d:\dump.sql


That’s it.

How to turn off MySQL strict mode?

Follow the below mentioned instructions to turn off or to disable the MySQL strict mode. This can be fixed in one of two ways

Method 1. 

Make the following changes in the “my.ini/my.cnf”:

1. Look for the following line , this line will set MySQL strict mode
sql-mode =  "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

2. To disable MySQL strict mode, you can change the above line as follow:
sql_mode="TRADITIONAL,NO_AUTO_CREATE_USER,,NO_ENGINE_SUBSTITUTION"

3. Restart the MySQL service.

Method 2 :
You may be able to run an SQL query within your database management tool such as phpMyAdmin which can normally be found from your web hosting control panel:

SET @@global.sql_mode= '';

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

List all loaded extensions in PHP

Hey we can easily get names of all modules compiled and loaded in the PHP using PHP’s built-in function called  get_loaded_extensions().  This function returns the names of all the modules compiled and loaded in the PHP interpreter.


<?php

print_r(get_loaded_extensions());

?>