Just reading the header you put in the question shows something interesting. In fact, the question shows three things:
MySQL dump 10.13 Distrib 5.1.34, for apple-darwin9.5.0 (i386)
indicates you used mysqldump from apple-darwin9.5.0 (i386) binaries
Server version 5.0.51a-24+lenny2
shows the version of mysql you used mysqldump to dump from.
- You wanted to load the mysqldump file into
Ver 14.14 Distrib 5.1.57, for apple-darwin10.3.0 (i386) using readline 5.1
What a jumble of versions to do this with.
If you want to see if mysqldump has an issue with the line that has DATEDIFF, try dumping just the schema.
mysqldump --no-data --all-databases ... > MySQLSchema.sql
This will display ony the schema. No INSERTs will be in the output. You can then hunt down that lines. You may also want to dump the data onyl without the schema,
mysqldump --no-create-info --all-databases ... > MySQLData.sql
Splitting the dumps allows you to load the schema into an editor and see if there are any problems. If you do not see any problems, load the MySQLSchema.sql into the target server. If the error is reproduced, you can fix the schema file and reload. Once the schema is loaded, you can separate load MySQLData.sql
BTW you should use mysqldump binary whose version is 5.0.51a-24+lenny2. Use dumps from version as mysqld is usually better to port and may minimize problems like this.
Give it a Try !!!
I would personally do it in one step with a pipe using mysqldump like so
mysqldump -u user_source -p --opt database_name table_name | mysql -u user_target -p --host=target_db_ip -C target_database
but if mysqldump is not allowed just save the dump somewhere you can access it then use wget to move it to the other server and unpack there using mysql. I normally use this command because it doesn't require me to stop the database and is a single command with no files rather than a process where I have to manage where the data files are.
Best Answer
In General if you have the credentials for accessing MySql from Machine B.
You should have MySQL user name , host name and Password.Then You can write the Command for taking backup
On Machine B Write
If You Face issues there may be some network issue try some things as