jessejohnston's avatar

ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

Hi all,

I've been having some issues with MySql and Laravel. When I try to migrate or show a table I get this error:

ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

I have no clue how or why the definer is set as 'mysql.infoschema' I'm also not able to find an easy clear way to change that. Any help or pointers in the right direction would be much appreciated.

0 likes
15 replies
bobbybouwmann's avatar

This commonly occurs when exporting views/triggers/procedures from one database or server to another as the user that created that object no longer exists. So basically you need to make sure you use the correct user in your database for all your migrations.

It sounds like you have the wrong user in the first place. Also if you did add/delete/update users make sure you run flush privileges; in mysql to make sure all caches are cleared regarding privileges ;)

Hayk_D's avatar

@greyeyes Did you try this?

mysql -u root -p
mysql> SET GLOBAL innodb_fast_shutdown = 1;
mysql_upgrade -u root -p
Hayk_D's avatar

@greyeyes I'd create a new user in MySQL, grant privileges on the database and try to use it instead or do the same for an existing user.

GRANT ALL ON *.* TO 'someuser'@'%' IDENTIFIED BY 'complex-password';
FLUSH PRIVILEGES;
munazzil's avatar

Use Host as below in your .env,

    DB_HOST=127.0.0.1
stellb's avatar

Hi @greyeyes, did you solve this issue? I'm pulling my hair with the same problem.

gladgladwrap's avatar

I'm also having the same problem. I've got mysql 8.0.15 Homebrew on both of my computers. When I run 'use db_name' from the iMac I get the' definer ('mysql.infoschema'@'localhost') does not exist' error. When I checked out what users are in the mysql.users table, mysql.infoschema did not show up as a user on the iMac, which is the one getting the error. On my air, that user does exist. Try: select host, user from mysql.user;

PaulGodard's avatar

Hi. I have the same problem (user mysql.infoschema does not exists in mysql.user table. I looked at gladgladwrap "solution" but it does not work for me. Can someone help please?

abdelkader123's avatar

I tried more to skip this error but its still exist so I hope everyone solved it correctly to reply me how got it

abdelkader123's avatar

welcome I wanna ask u about this error how can I skip thanks in advance

amumu's avatar

I think I'm quite late to the party but if you have any triggers set on your tables and the user who created it, has been deleted, then you will run into this error. I was facing the same issue. Tried clearing cache, config but nothing worked. I checked my db and found that there was a trigger set on table. Removing that trigger from the table did the trick. If you have any definer statements in you sql file, you can remove them before restoring.

I hope this helps someone. Cheers :)

Please or to participate in this conversation.