2.3.4.9 Testing The MySQL Installation测试MySQL安装

You can test whether the MySQL server is working by executing any of the following commands:您可以通过执行以下任意命令来测试MySQL服务器是否正常工作:

C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqlshow"
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqlshow" -u root mysql
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" version status proc
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" test

If mysqld is slow to respond to TCP/IP connections from client programs, there is probably a problem with your DNS. 如果mysqld对来自客户端程序的TCP/IP连接的响应很慢,那么您的DNS可能有问题。In this case, start mysqld with the skip_name_resolve system variable enabled and use only localhost and IP addresses in the Host column of the MySQL grant tables. 在这种情况下,在启用skip_name_resolve系统变量的情况下启动mysqld,并仅使用MySQL授权表的Host列中的localhost和IP地址。(Be sure that an account exists that specifies an IP address or you may not be able to connect.)(请确保存在指定IP地址的帐户,否则您可能无法连接。)

You can force a MySQL client to use a named-pipe connection rather than TCP/IP by specifying the --pipe or --protocol=PIPE option, or by specifying . (period) as the host name. 通过指定--pipe--protocol=PIPE选项,或者通过指定.(句点)作为主机名,可以强制MySQL客户端使用命名管道连接,而不是TCP/IP。Use the --socket option to specify the name of the pipe if you do not want to use the default pipe name.如果不想使用默认管道名称,请使用--socket选项指定管道名称。

If you have set a password for the root account, deleted the anonymous account, or created a new user account, then to connect to the MySQL server you must use the appropriate -u and -p options with the commands shown previously. See Section 4.2.4, “Connecting to the MySQL Server Using Command Options”.如果您已经为root帐户设置了密码,删除了匿名帐户,或者创建了新的用户帐户,那么要连接到MySQL服务器,您必须使用前面显示的命令使用相应的-u-p选项。请参阅第4.2.4节,“使用命令选项连接到MySQL Server”

For more information about mysqlshow, see Section 4.5.7, “mysqlshow — Display Database, Table, and Column Information”.有关mysqlshow的更多信息,请参阅第4.5.7节,“mysqlshow-显示数据库、表和列信息”