After the team has completed the database migration, the project is running, and the SQL report the user specified as a definer (' XX ' @ '% ') does not exist error. Internet query After discovery is a permissions issue.
The settlement bill is as follows:
1. If XX user does not exist in the database, create XX user
CREATE USER ' XX ' @ '% ' identified by ' password ';
2. Authorization to XX
Grant all privileges on * * to [e-mail protected] "%" identified by ".";
Flush privileges;
To create a user command:
CREATE USER ' username ' @ ' host ' identified by ' password ';
Description: Username-the user name that you will create, host-Specifies which host the user can log on to, if localhost is available to local users, you can use the wildcard% if you want the user to be able to log on from any remote host.
Password-The user's login password, the password can be empty, if it is empty, the user can not require a password to log on to the server.
Authorization command:
GRANT privileges on Databasename.tablename to ' username ' @ ' host ' identified by ' MyPassword ' with GRANT OPTION;
Description: Privileges-user's operation permissions, such as SELECT, INSERT, UPDATE, etc. Use all if you want to grant permissions.;d atabasename-database name, tablename-table name, if you want to grant the user the appropriate operation permissions on all databases and tables, such as *.
Identified by ' MyPassword ' connection password.
Example: If you want to allow users to connect to a MySQL server from a host myuser IP 192.168.1.6 and use MyPassword as a password
GRANT all privileges on * * to ' myuser ' @ ' 192.168.1.3 ' identified by ' MyPassword ' with GRANT OPTION;
FLUSH privileges;
MySQL the user specified as a definer (' XX ' @ '% ') does not exist