在Ubuntu18.04通过apt-get安装mysql服务
ub64@ub64-1804-1:~$ sudo apt-get install mysql-client-core-5.7
ub64@ub64-1804-1:~$ sudo apt-get install mysql-server
安装完成,中间过程并没有提示设置mysql的默认密码。不管了,先用root尝试登陆mysql试试。
ub64@ub64-1804-1:~$ mysql
ERROR 1045 (28000): Access denied for user 'ub64'@'localhost' (using password: NO)
ub64@ub64-1804-1:~$ mysql -u root
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
ub64@ub64-1804-1:~$ mysql -uub64
ERROR 1045 (28000): Access denied for user 'ub64'@'localhost' (using password: NO)
ub64@ub64-1804-1:~$ mysql -uub64 -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'ub64'@'localhost' (using password: YES)
提示报错了,不管是root还是本机用户名,都无法登陆。测试一下重启服务吧,还是不行。
ub64@ub64-1804-1:~$ service mysql start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units =