PDA

View Full Version : How to IMPORT DATA INTO YOUR MYSQL DATABASE



bahattab
12-12-2008, 11:56 PM
How to IMPORT DATA INTO YOUR MYSQL DATABASE


To import a sql file to an existing mysql database hosted on your account:


%/usr/local/nf/bin/mysql --force --quick -h mysqlhost -uUsername -pPassword DatabaseID < File.sql

$ mysql -uUser_vbforum -pPass_vbForum < /home/emad/public_html/databaseName_Backup_06-12-1429_11-55.sql


$ mysql -uVbforum -pVbForum2 < /home/emad/public_html/bahattab_06-12-1429_11-55.sql


NOTE: If you encounter a "max_questions" error, you should redo your mysql backup using the -e switch as in the example above. Then try the import command again.


IMPORTING TABLES INTO YOUR MYSQL DATABASE:
To import a table to an existing mysql database hosted on your account:


% /usr/local/nf/bin/mysql --force --quick -h mysqlhost -uUsername -pPassword DatabaseUD tablename < tables.sql


NOTE 1: For additional help in mysql commands: %mysql -h


NOTE 2: Commands such as myisamchk and grant are not permitted by users for security reasons.



SCHEDULING YOUR DATABASE BACKUPSTo create a cron job to schedule your database backups please click here (http://support.netfirms.com/article.php?id=710) for further instructions.




http://support.netfirms.com/idx.php/75/691/DATABASE-MANAGEMENT/article/How-do-I-manage-a-MySQL-to-import-or-export-my-database-using-SSH.html