mysql無法用root遠端登入解決方案
來源:https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7 說明: 自MySQL 5.7後登錄MySQL的root帳號需要sudo 故無法使用root登錄 解決方法:新建使用者 > 允許遠端連線 > 修改設定檔 執行步驟: 1.先連到MySQL sudo mysql --user=root mysql 2.為phpMyAdmin創建一個使用者 註:phpmyadmin為帳號 some_pass為密碼 CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES; 3.允許遠端登入 CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; 4.更改phpMyAdmin設定檔 sudo vim /etc/dbconfig-common/phpmyadmin.conf # dbc_dbuser: database user # the name of the user who we will use to connect to the database. dbc_dbuser='phpmyadmin' # dbc_dbpass: database user password # the password to use with the above username when connecting # to a databa