Unable to export db on stopping Local instance

Hi all,

I have a live site I’ve migrated from Liquid Web into Local. When I stop the site on Local, I get the error message:

Uh-oh! Local ran into an issue while exporting [my url] database to the site’s “app/sql” directory.

Log reads:

Aug 21, 2019, 2:24 PM EDT - info: [main/stopSite] Stopping site: running mydumper
Aug 21, 2019, 2:24 PM EDT - error: [main/exportDB]  
{ message:
   'mysqldump: Got error: 1449: The user specified as a definer (\'s1\'@\'localhost\') does not exist when using LOCK TABLES',
  stack:
   'Error: mysqldump: Got error: 1449: The user specified as a definer (\'s1\'@\'localhost\') does not exist when using LOCK TABLES\n    at (anonymous function).(anonymous function) (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/exporters/ExporterLocal.js:1:2864)\n    at process._tickCallback (internal/process/next_tick.js:68:7)' }
Aug 21, 2019, 2:24 PM EDT - info: [main/stopSite] Stopping site: stopping container 1e36a4dbc82c2b28c92bc429473f446ae2c4404703f16512f7005f3513d04de4

Any help would be much appreciated. Thanks!

Hey @lyons500, welcome to the community forums!

That error looks like there might not be a MySQL database user with the correct credentials, or possibly there is a table or view that needs more privileges in order to be set up correctly.

I think that you might need to log into the site and update the users and permissions for the tables of the database. To do this:

  1. Take a backup first!
  2. Right-click on the site and select “Open site SSH”
  3. Log into MySQL by typing: mysql
  4. Execute a sql statement to create a new s1 user and give them the permissions to work with the site. I think that this should work, but that’s also why we had you take a backup! :smiley:
CREATE USER 's1'@'localhost' IDENTIFIED BY 'complex-password';
GRANT ALL PRIVILEGES on local.* to s1@localhost identified by 'complex-password';
FLUSH PRIVILEGES;

Couple of things to note in the above command: s1 is the username in the above error message and complex-password is whatever secure password you would like for this user.

Let me know how that goes, or if you have any other questions!

I’m running into the same issue. However, taking a backup by running Export fails too as a result of the same privileges issue :confused:

I was able to use Sequel Pro’s GUI to basically do the same thing as that MySQL script, and the site now stops without issue.

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.