我有和这里类似的问题 。问题是那里提出的解决方案对我不起作用:
就目前而言,我有用户:
+----------+------------------------------------+
| user | host |
+----------+------------------------------------+
| root | 127.0.0.1 |
| root | localhost |
Run Code Online (Sandbox Code Playgroud)
两者都没有密码(就目前而言。我知道这很糟糕!)。
我正在使用以下命令连接到 mysql:
mysql -u root -h 127.0.0.1 --protocol=tcp
Run Code Online (Sandbox Code Playgroud)
登录后,我得到:
mysql -u root -h 127.0.0.1 --protocol=tcp
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.61-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or …Run Code Online (Sandbox Code Playgroud)