I'm fairly new to databases. I want to upload a .sql file to a mysql server. However the database I want to update contains many .frm .myi .myd files. Should I delete those files and replace with the .sql?
Any suggestions/tips would be greatly appreciated.
-
from shell "mysql -u yourserver -p -D dbname < your_sql_script.sql"c4f4t0r– c4f4t0r2014年03月07日 16:59:19 +00:00Commented Mar 7, 2014 at 16:59
-
What will "uploading" the .sql file accomplish? For example does the .sql file contain commands to create tables you wish to deploy on your database server?Jeremy– Jeremy2014年04月10日 14:33:19 +00:00Commented Apr 10, 2014 at 14:33
1 Answer 1
Back up the old database files to a dump using mysqldump -u username -p database_name > dump.sql
then import the new sql file using mysql -u username -p database_name < new_sql_file.sql
.