登入 MySQL localhost 錯誤

. . . .
.

img

https://upload.wikimedia.org/wikipedia/zh/6/62/MySQL.svg

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解決方式:

sudo mysql -u root

mysql> USE mysql;

mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';

mysql> FLUSH PRIVILEGES;

mysql> exit;

sudo service mysql restart

安裝的時要另外下載Zip解壓縮放到web的目錄下:

/var/www/html/phpmyadmin

也要把根目錄指到這裡:

<VirtualHost *:80>
        ServerName csie.one
        ServerAdmin [email protected]

        DocumentRoot /var/www/html/myadmins
        <Directory /var/www/html/myadmins>
                AllowOverride All
        </Directory>
</VirtualHost>

資料來源:Install MySQL with phpMyAdmin on Ubuntu



Tags: MySql