« Bulk Modify Access Permissions of Views in Drupal | Main | Advanced help patch for Views »

November 15, 2010

Copy and import a mySQL database

This is the original source.

$ sudo mysqldump -u [dbUserName] --password=[dbUserPword] [dbName] | mysql -u [dbUserName] --password=[dbUserPword] -h localhost [dbName]

The first part dumps database 1 and the second part imports the dump into database 2.

Notes on connecting to mySQL via command line:

$ mysql -u [dbuser] -h [dbhost] -p


Import a database:

$ mysql -u [dbuser] -p -h [dbhost] [dbname] < [db_toimport.sql]

SFTP into a machine through a non-standard port

$ sftp -oPort=[port] [username]@[host]

Posted by kkwaiser at November 15, 2010 04:37 PM


Login to leave a comment. Create a new account.