參考網址:www.bos.tw
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)
使用配置文件中定義的控制用戶連接失敗
1、打開phpmyadmin文件夾下面的config.inc.php文件並打開,找到
1 2 |
$cfg[‘Servers’][$i][‘controluser’] = 'pma'; $cfg[‘Servers’][$i][‘controlpass’] = ''; |
將其註解掉並改成你的資料庫用戶和密碼,存檔
1 2 |
$cfg[‘Servers’][$i][‘controluser’] = 'root'; <—- 自己資料庫的用戶名稱 $cfg[‘Servers’][$i][‘controlpass’] = '123456'; <—- 自己資料庫的用戶密碼 |
上個方法似乎無效
mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)
https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7
在mysql資料庫中建立phpmyadmin使用者
1. Connect to mysql
sudo mysql --user=root mysql -p
2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass
by the desired password):
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;