Reputation: 83
I am trying to call a stored procedure with php. The previous day this was working, but today i get an error that "The user specified as a definer ('name of the user'@'my ip the previous day') does not exist"
The procedure is located in a host and i grant to my ip access through cpanel's remote MySql. The code that i used is correct and taken from here http://www.php.net/manual/en/mysqli.quickstart.stored-procedures.php
Does the error occur because my ip is different today, even though i have access again? How can i solve it?
Upvotes: 5
Views: 12191
Reputation: 3969
With the MySQL Ansible Module
- name: create root@% user
mysql_user: name=root host=% password=password priv=*.*:ALL,GRANT state=present
Upvotes: 0
Reputation: 1099
If you've found following error while using mysql database: The user specified as a definer ('root'@'%') does not exist Then you can solve it by using following :
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
Credit to http://www.lynnnayko.com/2010/07/mysql-user-specified-as-definer-root.html
Upvotes: 10
Reputation: 1041
The user that created the procedure must've been deleted. Since your user id is mapped to an ip address, the change of the IP is most probably the cause. If you can recreate the user, that would work.
or, try this:
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
This is a slightly insecure way to handle it, but if its just local biz, it shouldn't be a problem.
Source: http://www.lynnnayko.com/2010/07/mysql-user-specified-as-definer-root.html
Upvotes: 2