# How do I fix the "1227" error? An `ERROR: 1227 (42000)` usually occurs when the `DEFINER` in your dump file doesn’t have the `doadmin` permission. `DEFINER` errors are triggered when MySQL attempts to create an object under a database user that doesn’t exist on the target database. To resolve this error, you need to either remove the `DEFINER` from the dump file or replace it. ## Remove the DEFINER To remove the `DEFINER` from the dump file, run the following `sed` command from the [Droplet terminal](https://docs.digitalocean.com/products/droplets/how-to/connect-with-console/index.html.md) where the dump file is located. `sed` is a Unix utility that searches for and transforms text based on a pattern that you provide it. ```shell sed 's/\sDEFINER=`[^`]*`@`[^`]*`//g' -i yourdumpfile.sql ``` This `sed` command filters through the dump file looking for text that matches the regular expression provided in the command. When `sed` encounters a match, it substitutes the matched line with nothing, effectively deleting the line in the file. The `-i` flag allows `sed` edit the file in place instead of creating and saving a new file with the changes. ## Replace the DEFINER To replace the `DEFINER`, run the command below to generate a new dump file using the `--set-gtid-purged=OFF` flag. This generates a dump file that contains a `DEFINER` with the correct permissions. Before running this command, replace the ``, ``, ``, and `` placeholder values with your user and database values: ```shell mysqldump --user= --password= --host= -P 25060 --set-gtid-purged=OFF --databases > dbexport.sql ``` This generates a file called `dbexport.sql`, which you can then use to restore the database by running the following command using the `doadmin` user: ```shell mysql --user=doadmin --password= --host= -P 25060 < dbexport.sql ``` ## Related Topics [How do I fix the mysqldump "Couldn't execute FLUSH TABLES Access denied" error?](https://docs.digitalocean.com/support/how-do-i-fix-the-mysqldump-couldnt-execute-flush-tables-access-denied-error/index.html.md): Update backup user permissions, remove the –single-transaction flag, or downgrade mysqldump. [Why does MySQL shut down when importing data with the source command?](https://docs.digitalocean.com/support/why-does-mysql-shut-down-when-importing-data-with-the-source-command/index.html.md): Use MySQL’s import command instead of source for handling large data imports. [How do I fix the "Out of sort memory" error?](https://docs.digitalocean.com/support/how-do-i-fix-the-out-of-sort-memory-error/index.html.md): Adjust the sort\_buffer\_size value while assessing its impact on memory consumption and query performance.