Ok, so I’m in need to restore a table and I do:
mysqldump --opt database table_name < table_name.sql
I hit enter and Done! Well, not really, when I go to see if there is anything on the table it show 0 records.
I have look into the table_name.sql and I see two records.
What am I doing wrong?
mysqldumpis the wrong command for restoring from a backup.You need to run
mysql, as in, the mysql client. It’s generally something like this:mysql -u username -p database_name < sqlfile.sqlThat will use your file as input to the mysql client, which subsequently executes the SQL.