Showing posts with label Mysql. Show all posts
Showing posts with label Mysql. Show all posts

Monday, September 19, 2011

Import and Export MySQL Database

Export command:


By using mysqldump — A Database Backup Program.


mysqldump -u username -p -h localhost dbname > dbname_exported_file.sql


Where -u : username
      -p : password
      -h : host name


By using the above command line, we can export database into the specified file.


Import command:


If we need to import to exported sql file.


mysql -u username -p -h localhost dbname < dbname_exported_file.sql


It imports all the queries into the database.


For references, check the URL http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

Thursday, September 15, 2011

Mysql Error no: 150

ERROR 1025 (HY000): Can't create table '.\database\#sql-1295_318.frm' (errno: 150).
We will encounter this problem typically when the tables have been created with different Engines

E.g one is of the type INNODB and the other is of the type MyISAM.