我已經在Ubuntu 16.04安裝MySQL的MySQL服務器:我無法連接到我剛剛安裝
sudo apt-get install mysql-client-5.7 mysql-server-5.7
檢查安裝運行此命令:
mysql --version
mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper
而且還有:
systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2017-10-06 16:34:36 CEST; 28min ago
Process: 3521 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
Process: 3511 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 3520 (mysqld)
CGroup: /system.slice/mysql.service
└─3520 /usr/sbin/mysqld
Oct 06 16:34:35 SV1080AP1105 systemd[1]: Starting MySQL Community Server...
Oct 06 16:34:36 SV1080AP1105 systemd[1]: Started MySQL Community Server.
但是,當我試圖連接它不起作用!
sudo mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
你必須使用一個密碼,我想 –