Actually it seems a backup by copy files (as tables are myisam tables) not a mysqldump. So you just need to untar this compressed file by below command on linux-
$ untar -zxvf your_backup.tar.gz .
Note: Please run this command from the directory where your backup file exist and it will provide you normal backup also in same directory.
Now you can simply copy these files (*.frm, *.MYI, *.MYD) to your database directory in which Database you want to restore them and it should work.
Note: if there is any permission related issue then use below command to make sure mysql can use these files/tables.
$ chown -R mysql:mysql /path_till_your_db_directory/*
See the mydata.csv file at bottom of the answer.
I created a table xy
CREATE TABLE `xy`
(
`fred` int(11) DEFAULT NULL,
`mary` int(11) DEFAULT NULL,
`billy` varchar(50) DEFAULT NULL
);
From the documentation here, I tried this
LOAD DATA INFILE 'mydata.txt' INTO TABLE tbl_name
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
But that failed (only one line imported). I changed \r\n to \n (Unix), that was better (all lines imported, but no \ in the VARCHAR field - they were simply deleted).
Further Googling led me here
So I tried this (from the answer)
LOAD DATA INFILE 'mydata.csv' INTO TABLE xy
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY ''
LINES TERMINATED BY '\n';
(note ESCAPED BY '' - i.e. nothing - the \ is the default escape character).
And that worked (sample of four lines in table xy below)
| 2 | 3 | asf\dsadfs |
| 2 | 3 | asfdsadfs |
| 2 | 3 | asfdsadfs |
| 2 | 3 | asf\dsadfs |
My sample mydata.csv file
2,3,asfdsadfs
2,3,asfdsadfs
2,3,asfdsadfs
2,3,asfdsadfs
2,3,asfdsadfs
2,3,asfdsadfs
2,3,asfdsadfs
2,3,asf\dsadfs
2,3,asfdsadfs
2,3,asfdsadfs
2,3,asf\dsadfs
2,3,asfdsadfs
2,3,asfdsadfs
2,3,a\sfdsadfs
2,3,asfdsadfs
2,3,asfdsadfs
Best Answer
As you've described the situation, no — if you have the original file or even access to the original database, you could compare what he sent you with what you're able to get yourself. However, with only the file he's provided, there's no way to determine whether it's been edited. The .sql file is simply a plain text file and there's no audit trail that can ensure — after the fact — that he hasn't modified anything.