0

SCRIPT:

#!/bin/sh

mysqldump --opt --protocol='TCP' -h'XXXXXXXX' -u 'XXXX' --password='XXXXX' databaseName | mysql -h 'XXXXX' -u'XXXXX' --password='XXXXX' databaseName

Before running script, chomd 775 on script and execute it using bash filename.sh. Get errors:

'ERROR 1102 (42000): Incorrect database name 'databaseName
mysqldump: Got errno 32 on write

Disk space and write permissions are not the cause. What else may I try?

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • The error message is pretty clear: you didn't specify the correct database name as the last argument. – Barmar Jun 04 '21 at 23:21
  • Did you replace `databaseName` with the actual name of the database that you want to update? – Barmar Jun 04 '21 at 23:23
  • Yes. I replaced the databaseName with the actual name of the database that I want to update. And, I am certain of the DB name; I am sure the name I used is right. – KenticoLover Jun 05 '21 at 02:32
  • error 32 seems to be a pipe error. refer to https://stackoverflow.com/questions/22288271/mysqldump-got-errno-32-on-write – abhishek phukan Jun 05 '21 at 04:40
  • Error 32 in `mysqldump` is because of the error in `mysql`. It's trying to write to the pipe, but `mysql` exited because the database doesn't exist. – Barmar Jun 05 '21 at 15:21
  • The error message should have `'` before and after the database name, but the second `'` is missing. Is that a copying error or is it really missing ? – Barmar Jun 05 '21 at 15:22
  • If the latter, I suspect there's a `\r` character in your script. Use `dos2unix` to fix it. – Barmar Jun 05 '21 at 15:22
  • I actually did have the single quote around the database, like 'xxx' The DB still was not recognized. I also saw before writing this post, the other ticket, https://stackoverflow.com/questions/22288271/mysqldump-got-errno-32-on-write. More than likely there is an issue with the \r. I will try that. – KenticoLover Jun 07 '21 at 12:03
  • continued....However, the other issue is the pipe. Writing to the pipe creates deadlocks which takes down the system. So, I am going to try a two step approach and do the backup to file and then read the file into the other DB. Unless someone knows how to prevent the deadlock, I think I need to use the two part solution. Thank you to all for your comments/help. – KenticoLover Jun 07 '21 at 12:03

0 Answers0