在 ubuntu 18.04 中安装 phpmyadmin 时显示错误

Showing error while installing phpmyadmin in ubuntu 18.04

By default, phpmyadmin will be configured to use a MySQL server through a local Unix socket (this provides the best performance). To connect with a different method, or to a different server entirely, select the appropriate option from the choices here.

提示询问您要使用哪种连接类型。 MySQL 可以使用本地类似文件的资源,称为 socket 用于不同进程相互通信。套接字仅限于本地使用,因此如果您希望使用 phpMyAdmin 访问远程 MySQL 实例,这将不起作用。另一个选择是网络连接,TCP/IP。 TCP/IP 可用于连接到本地 MySQL 服务器,虽然它在技术上不如套接字连接那么快,但它仍然适合我的使用。

基本上,如果您要连接到远程主机,则需要 select TCP/IP,否则任一答案都可以,但套接字更可取。

您应该注意,用户帐户主机名也在这里发挥作用;套接字连接验证主机名 'localhost',因此如果您的用户帐户是 user@127.0.0.1 或 user@%,那么您将无法连接。对于 TCP/IP 网络,本地连接通过 127.0.0.1(通常)连接,它使用 % 通配符。 'localhost' 不是“%”通配符集的一部分。