我猜我忘记了一些明显的东西,但我似乎无法连接127.0.0.1使用MySQL.通过localhost工程连接.
MySQL/Linux版本: Server version: 10.0.31-MariaDB-0ubuntu0.16.04.2 Ubuntu 16.04
这有效:
$ mysql -h localhost -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 71982
Server version: 10.0.31-MariaDB-0ubuntu0.16.04.2 Ubuntu 16.04
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
Run Code Online (Sandbox Code Playgroud)
这并不能正常工作:
$ mysql -h 127.0.0.1 -u root
ERROR 1698 (28000): Access denied …Run Code Online (Sandbox Code Playgroud)