1449-The user specified as a definer('root'@'localhost') does not exit

1449-The user specified as a definer(‘root’@‘localhost’) does not exitjava

當你安裝好了數據庫,內心一陣舒爽的時候,而後你懷着激動的心情,安裝navicat for mysql 。
安裝~~~~
完成~~~~
打開~~~~
創建鏈接~~~~mysql

突然你忽然發現了下面的狀況web

1449-The user specified as a definer(‘root’@‘localhost’) does not exitsql

????數據庫

此刻的心中彷彿出現了一萬個***;ide

我當時馬上就百度了不少的博客,但是和個人錯誤,有點像,按他們的方法來以後,卻又解決不了。svg

以後我發現了,他們都有一個共同點,那就是指向了一個
那就是spa

權限問題

怎麼解決權限問題呢,

當你看到其餘人的博客去解決這個問題的時候,code

發現按他們的方法去作了,卻依舊沒有成功,xml

那這個緣由呢就是版本的問題了

8.0.11版本以後移除了grant 語句添加用戶的功能

因此呢按照下面的方法去作就能夠啦

注意:
下面的root %
均要改爲你報錯的時候提示的
怎麼理解呢
1449-The user specified as a definer(‘root’@‘localhost’) does not exit
個人報錯是這個
我就改爲了
mysql> create user ‘root’@‘localhost’ identified by ‘密碼’;

mysql> create user 'root'@'%' identified by '密碼';
    Query OK, 0 rows affected (2.00 sec)
     
    mysql> grant all privileges on *.* to 'root'@'%';
    Query OK, 0 rows affected (0.21 sec)
     
    mysql> flush privileges;
    Query OK, 0 rows affected (0.22 sec)

但願對你有所幫助,有幫助的話。就點個贊👍吧。