#1449 - phpMyAdmin (The user specified as a definer ('***'@'localhost') does not exist)

the user specified as a definer (''@'localhost') does not exist
the user specified as a definer ('root'@'%') does not exist in mysql
the user specified as a definer does not exist magento 2
change definer mysql
operationalerror 1449 the user specified as a definer root does not exist
mysql remove definer
got error 1449 the user specified as a definer does not exist when using lock table
mysql definer

I am currently transferring all of my 'Views' from a VPS hosted with 123-reg to another VPS provided by Heart Internet.

Here is the View:

CREATE ALGORITHM=UNDEFINED DEFINER=`etd`@`localhost` SQL SECURITY DEFINER VIEW `vShoppingCart` AS SELECT `VCoursesUOC`.`Distributor` AS `Distributor`,`VCoursesUOC`.`Company` AS `Company`,`VCoursesUOC`.`Title` AS `Title`,`VCoursesUOC`.`Price` AS `Price`,(`VCoursesUOC`.`Price` / 5) AS `VAT`,(`VCoursesUOC`.`Price` * 1.2) AS `WithVAT`,(sum(`VCoursesUOC`.`Price`) * 1.2) AS `Total`,count(`VCoursesUOC`.`CourseId`) AS `NoOfCourses` FROM `VCoursesUOC` WHERE (`VCoursesUOC`.`Payment` = 'Unpaid') GROUP BY `VCoursesUOC`.`Title`,`VCoursesUOC`.`Distributor`,`VCoursesUOC`.`Company`,`VCoursesUOC`.`Price`

Everytime I try to run this I get the following error:

#1449 - The user specified as a definer ('etd'@'localhost') does not exist

I have tried to change etd to root and a Database username on the MySQL Database but it does not fix the error.

What can I try?

I am logged in to phpMyAdmin as the root user.

The user does not exist, so you either need to create it or to use another user, which exists and has the necessary privileges.

etd is a user used at the original source as a definer.

The user specified as a definer ('root'@'%') does not exist, Has to be a PROXY situation. As MySQL's documentation says: When authentication to the MySQL server occurs by means of an authentication plugin, the  mysql> UPDATE `users` SET `somefield` = 1 WHERE `user_id` = 2; ERROR 1449 (HY000): The user specified as a definer ('root'@'%') does not exist If you really want to find the problem, just run this commands one by one:

The DEFINER is optional in the MySQL CREATE VIEW statement.

You could try modifying the statement to remove the DEFINER = 'user'@'host' from the statement.

That would be equivalent to specifying DEFINER = CURRENT_USER in the statement.

Given the SQL SECURITY DEFINER, this will impact the security context of the view.


If you want to specify a DEFINER in the view definition (in the CREATE VIEW statement), the specified user will need to exist in MySQL.

Note that a "user" in MySQL is identified by both a username and and host.

That is, 'etd'@'%' is a different user than 'etd'@'localhost'.

To create a user, you can run a statement like this:

GRANT USAGE ON *.* TO 'etd'@'localhost' IDENTIFIED BY 'mysecretpassword'

This same user will also need to be granted appropriate SELECT privileges on the tables underlying the view,


To create a user on a MySQL instance, where you want to "copy" the definition from another MySQL instance to another...

On the "source" instance (where the 'etd'@'localhost' user that we want to "copy" exists, we can run a statement like this statement:

 SHOW GRANTS FOR 'etd'@'localhost'

The rows returned by that are a pretty good representation of the statements we would need to run on another MySQL instance, to create the user there.

Solutions-MySQL error 1449: The user specified as a definer does , Explaining and providing solutions of MySQL error 1449: The user specified as a definer does not exist using SQL SECURITY INVOKER and  SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('root'@'localhost') does not exist. This is because the user root doesn’t exists in mysql.global_priv table. So you need to create one. First you need to connect to database through command line: plesk db. and then create the user root: CREATE USER root@localhost;

  select user, host from mysql.user; 

You can use this command for getting your user and host information. If you are using root as user then try with root@localhost

MySQL error 1449: The user specified as a definer does , MySQL error 1449: The user specified as a definer does not exist - This is possibly easiest to do when initially importing your database objects, by removing any  First, this is not a duplicate of: MySQL error 1449: The user specified as a definer does not exist I have a php app that's been running fine for 5 years, which runs

Error: The user specified as a definer ('root'@'%') does not exist, Hi. You should run the following commands: -- Remove current user DROP USER 'root'@'%'; -- Add ROOT user again CREATE USER  Explaining and providing solutions of MySQL error 1449: The user specified as a definer does not exist using SQL SECURITY INVOKER and DEFINER.

MySQL error 1449: The user specified as a definer , I was recently working with a sidekick thing where I was using MySQL as my backend database. This was accessed from the application with  That would be equivalent to specifying DEFINER = CURRENT_USER in the statement. Given the SQL SECURITY DEFINER , this will impact the security context of the view. If you want to specify a DEFINER in the view definition (in the CREATE VIEW statement), the specified user will need to exist in MySQL.

#1449 - phpMyAdmin (The user specified as a definer , 1449 - phpMyAdmin (The user specified as a definer ('***'#'localhost') does not exist) - php. The user specified as a definer (dev@localhost) does not exit - MySQL error 1449. I am still getting used to MySQL and experienced this situation first time. Wasted 20 minutes trying to figure out why I was getting this exception.

Comments
  • the user is missing ??
  • But 'etd' has never existed on the new VPS so how does it know what user it is? I have tried changing 'etd' to the username linked to the database I am running it on and it still does not work.
  • try to create new user then try
  • But where is it getting etd from? :S
  • Follow these steps: 1.Go to PHPMyAdmin 2.Select Your Database 3.Select your table 4.On the top menu Click on 'Triggers' 5.Click on 'Edit' to edit trigger 6.Change definer from [user@localhost] to root@localhost
  • How do I create the user?
  • @user6618037, please read this article, at the end you should be able to create a user: dev.mysql.com/doc/refman/5.7/en/create-user.html
  • @spenser7593 The SHOW GRANTS shows: GRANT USAGE ON . TO 'etd'@'localhost' IDENTIFIED BY PASSWORD '*RANDOMCODE'
  • @user6618037: You can take the output from the SHOW GRANTS statement (executed on the "source" instance, where you want to copy the user from), and take that over to another database instance, and execute those statements (add semicolons) to create the user. (I would note that "can't get it to work" is not particularly descriptive of the behavior you observe, as far as helping to identify the problem.)