An error that the MySQL user does not exist

Source: Internet
Author: User

Pre-array Recycling production account access range, that is [email protected] "%" of the account naming method, modified into a number of front-end application deployment of the machine IP as the standard, modified to [email protected] "IP address." Minimize the occurrence of non-trusted client connection databases and enhance data security.

but is the recovery [email protected] "%" account found that the production of a subsystem has been an error, [email protected] "%" account does not exist exception. Start by checking the configuration of the JDBC database connection string for the production code to find that the address is configured as the hostname of the server. The suspicion is that the domain name is incorrectly resolved to the IP address of the external network, it is modified to the intranet IP after the re-issued version of the same error still exists.

Later after the investigation and finally found that because the subsystem also uses a trigger, but before the trigger is not defined definer, resulting in the definer of the trigger is the current user, that is: [email protected] "%".

Originally, when the user is deleted, MySQL will only affect the MySQL system library's user table, DB table and Tables_priv table, and the user-created trigger is not deleted by the joint, Because the trigger information is stored in the triggers table of the Information.schema library. Therefore, other ordinary users (without administrator privileges) want to invoke other user's trigger, will be an error.

When the problem is fixed, it is easy to solve:

1, delete the original [email protected] "%" trigger, redefine definer as [email protected] "IP address" trigger

2, the ordinary account can call trigger, need to configure multiple triggers permissions, do not report trigger permissions error.

To summarize:

The database is a database, it is the ability to store data and retrieve data, although the database also has triggers, custom functions and stored procedures such as functions, but the implementation of functions at the expense of the database part of the performance of the implementation. It also causes the front end application to be tightly coupled with the backend service, with changes in the front end and subsequent services to change. Therefore, unless there are special scenarios such as BI, data analysis, and so on, the general production environment disables trigger, functions, and stored procedure. Reduce the load on your database by implementing its capabilities at the code level.



This article is from the "thick Product Thin Hair" blog, please make sure to keep this source http://1057212.blog.51cto.com/1047212/1910433

An error that the MySQL user 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.