Reputation: 1168
Recently, I deleted a user account in MySQL assigned to my former boss. Then, some database functions like deleting records from tables he made weren't working, giving the following error:
#1449 - There is no '*username*'@'localhost' registered
Now, I added a new user with the same name (and diff. password) and it works fine with no errors. But, is there way to resolve this without an placeholder user account?
Upvotes: 2
Views: 6725
Reputation: 1168
I had to remove and re-add the triggers for the affected tables. (I used phpMyAdmin to do this).
Upvotes: 2
Reputation: 44343
Try replacing the DEFINER of the function
First login to mysql as root@localhost
Then, substitute root@localhost
as the DEFINER
UPDATE mysql.proc SET definer='root@localhost'
WHERE definer = '*username*@localhost';
In fact, you can look at all DEFINERs like this:
SELECT COUNT(1) DefinerCount,definer,type
FROM mysql.proc GROUP BY definer,type;
This will show you how many functions and procedures each user owns. If any other the reported DEFINERs no longer exist or are invalid, you can make root@localhost
inherit them.
Give it a Try !!!
Upvotes: 5