如何从远程主机使用 mysqltuner

Mah*_*raV 4 mysql mysqltuner

我们无法通过操作系统控制台访问我们的服务器。我们的生产环境是Ubuntu 12。是否可以从远程主机使用mysqltuner?如果是,请提供指南。我们使用的是mysql5.6

Rol*_*DBA 5

我要向您展示的内容来自mysqltuner.pl 代码的第 89-122 行:

你仍然需要像 mysql 客户端一样连接:

Connection and Authentication
    --host <hostname>    Connect to a remote host to perform tests (default: localhost)
    --socket <socket>    Use a different socket for a local connection
    --port <port>        Port to use for connection (default: 3306)
    --user <username>    Username to use for authentication
    --pass <password>    Password to use for authentication
Run Code Online (Sandbox Code Playgroud)

由于您使用的是远程主机,因此请使用参数从操作系统提供值

--forcemem <size>    Amount of RAM installed in megabytes
--forceswap <size>   Amount of swap memory configured in megabytes
Run Code Online (Sandbox Code Playgroud)

您可能需要联系远程系统管理员询问您有多少 RAM 和交换空间

如果数据库有太多表或非常大的表,请使用以下命令:

--skipsize           Don't enumerate tables and their types/sizes (default: on)
                     (Recommended for servers with many tables)
Run Code Online (Sandbox Code Playgroud)