Home  >  Article  >  Database  >  Detailed explanation of solutions to 1449 and 1045 exceptions when connecting to MySQL

Detailed explanation of solutions to 1449 and 1045 exceptions when connecting to MySQL

黄舟
黄舟Original
2017-09-06 14:47:121295browse

This article mainly introduces the relevant information about the solutions to 1449 and 1045 exceptions when connecting to MySQL. When connecting to MySQL through IP, 1499 and 1054 error exceptions will occur. Solutions are provided here. Friends in need can refer to them.

Solution to 1449 and 1045 exceptions when connecting to MySQL

mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法

Direct the sql to the local and execute the stored procedure Or check the video error report:

mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法

Permission problem, grant all sql permissions to root

mysql> grant all privileges on *.* to root@"%" identified by ".";
 
SQLException: The user specified as a definer ('ebook'@'%') does not exist:解决办法
grant all privileges on *.* to ebook@"%" identified by ".";
Query OK, 0 rows affected (0.00 sec)


mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
#Mysql

A 1045 exception occurred during connection:

If it is before mysql 5.6, enter

UPDATE mysql.user SET Password=PASSWORD('123456') WHERE User='root';

If it is after mysql 5.6 , enter

UPDATE mysql.user SET authentication_string=PASSWORD('root') WHERE USER='root';

This is because there is no password field in the user table after 5.6.

Enter FLUSH PRIVILEGES; to refresh the database.

The above is the detailed content of Detailed explanation of solutions to 1449 and 1045 exceptions when connecting to MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn