MySQL the user specified as a definer (' XX ' @ '% ') does not exist

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.