iT邦幫忙

0

透過 brew 安裝 mariadb 套件錯誤 Pimple\Exception\UnknownIdentifierException: Identifier mysql is not defined

  • 分享至 

  • xImage

我在 macos 安裝 mariadb 透過 brew

mysql.server start
Starting MariaDB
 SUCCESS! 

但我發現我的程式出現了錯誤
以下是完整錯誤

<b>Fatal error</b>: Uncaught Pimple\Exception\UnknownIdentifierException: Identifier "mysql" is not defined.
in /Users/xxx/Projects/abc/vendor/pimple/pimple/src/Pimple/Container.php:101
Stack trace:
#0 /Users/xxx/Projects/abc/public/meekro.php(3): Pimple\Container->offsetGet('mysql')
#1 /Users/xxx/Projects/abc/public/index.php(26): include_once('/Users/xxx/Proj...')
#2 {main}
thrown in <b>/Users/xxx/Projects/abc/vendor/pimple/pimple/src/Pimple/Container.php</b> on line <b>101</b><br />

實在是搞不清楚發生什麼事
有大大有遇過嗎?

補充
我執行了 mysql_secure_installation
發現會出現錯誤:

Enter current password for root (enter for none): 
/usr/local/bin/mysql_secure_installation: line 249: .my.cnf.55486: Permission denied
/usr/local/bin/mysql_secure_installation: line 250: .my.cnf.55486: Permission denied
/usr/local/bin/mysql_secure_installation: line 251: .my.cnf.55486: Permission denied
/usr/local/bin/mysql_secure_installation: line 253: .my.cnf.55486: Permission denied
/usr/local/bin/mysql_secure_installation: line 218: .mysql.55486: Permission denied
/usr/local/bin/mysql_secure_installation: line 220: .mysql.55486: No such file or directory

但我是可以登入資料庫的

xxx @ etc $ mysql -u aaa -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.4.13-MariaDB Homebrew

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

(另一個問題⋯⋯ https://ithelp.ithome.com.tw/questions/10199588

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答