This is actually a very easy thing to accomplish. On the source system, I run the following command:
mysqldump -u
Where -u is a switch to accept the database username to use, -p will prompt for a password, and the last entry is the database to export, in this case the sguildb database. Now, I have a large script that will rebuild the Sguil database on my development system in my user directory.
I log into the target system, and copy the script using the following command:
scp
This will use the secure copy command to copy the sguildb.sql file from my source system to the local target system.
In order to import, I run the following command:
cat sguildb.sql | mysql -p -D sguildb
Where -p will prompt for a password, and -D is the database switch. I do not use the username switch since I am using my local user account name to login to the database.
No comments:
Post a Comment