Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly this error is?

Database i am using is MySQL 5.1. I specified, i believe, right connectionstring in my web.config. but when i run my web app. it throws this exception:-

MySql.Data.MySqlClient.MySqlException: The user specified as a definer ('root'@'%') does not exist

Any help. Why am i getting this?

like image 882
Jango Avatar asked Mar 07 '10 23:03

Jango


People also ask

What is error explain with example?

1. The definition of an error is a mistake or the state of being wrong. An example of an error is when you add 2+2 and get 5. An example of error is when a mistake leads you to come to the wrong collusion and you continue to believe this incorrect conclusion. noun.

What causes an error?

Common sources of error include instrumental, environmental, procedural, and human. All of these errors can be either random or systematic depending on how they affect the results. Instrumental error happens when the instruments being used are inaccurate, such as a balance that does not work (SF Fig.

What are 5 types of errors?

The errors that may occur in the measurement of a physical quantity can be classified into six types: constant error, systematic error, random error, absolute error, relative error and percentage error.


3 Answers

The source code for the stored procedures that you have been loading probably contain "DEFINER=root@'%'" as part of the definition - looking a bit like this:

create definer='root'@'%' procedure sp_test() begin end;

The problem here is that you do not have an account on your system for 'root'@'%'. This can be easily demonstrated. From the MySQL command line:

show grants for 'root'@'%';

I expect that this will come back with an error message:

ERROR 1141 (42000): There is no such grant defined for user 'root' on host '%'

The fix is to alter the source of your stored procedures, or to create the missing account:

grant all on *.* to 'root'@'%' identified by 'password' with grant option;

It is not generally a good idea to have such a high-powered account accessible from anywhere, but that is another story.

like image 86
Martin Avatar answered Oct 20 '22 21:10

Martin


I know this answer comes very late, but I found a solution that doesn't involve changing any rights at all.

Go into your Stored Procedures and delete the DEFINER clause. The server should write in a new DEFINER that matches the user information you're logged in with.

Worked for me...

like image 22
Ortund Avatar answered Oct 20 '22 20:10

Ortund


Is this in a stored procedure? Then maybe this blog post helps (emphasis mine).

All the settings were fine and I was wondering what’s causing the problem. At first rush I thought that it could be a cache, as I had requested recently to have xcache on our server.

But it wasn’t the case. The error was much more stupid than even one can imagine. That specific script uses a stored procedure to insert / fetch data to/from MySQL. The user who had created the sp was the one who was deleted. And that was the problem. The term “Definer” in terms of MySQL is the one who creates the stored procedure and for the stored procedure to be executed that user must exists.

like image 2
Pekka Avatar answered Oct 20 '22 22:10

Pekka