MYSQL

...now browsing by category

 

Quickie - Import Database to MYSQL via SSH/Linux

Friday, December 12th, 2008

Here is a quickie for importing an sql file to mysql on linux….

mysql -u -p dbname < sqlfile

Example

> mysql -u root -p wordpress_db < "/home/webster/backup.sql"
> Enter Password:

And there you have it…

MYSQL Backup Quickie

Saturday, November 22nd, 2008

Okay, due to timing I will be adding very quick tutorials/notes for myself.  Selfish I know, but it could prove to be of use to starters as well.

If you have your SSH handy + access to working with your database, run the following command to backup your database.

mysqldump -username -password databaseName > nameoffile.sql

So, for example - if you have a root account with the password Password and a database named MyDB and you wanted to call the backup MyDBBackup.sql and save the file into your /home/username directory.

mysqldump -root -p MyDB > /home/username/MyDBBackup.sql