Loading...
pip install mysql_mcp_server_pro{
"mcpServers": {
"mysql": {
"command": "uvx",
"args": [
"--from",
"mysql_mcp_server_pro",
"mysql_mcp_server_pro",
"--mode",
"stdio"
],
"env": {
"MYSQL_HOST": "192.168.x.xxx",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "root",
"MYSQL_DATABASE": "a_llm",
"MYSQL_ROLE": "admin"
}
}
}
}execute_sqlExecutes SQL queries against the MySQL database, subject to role-based permissions.
Can modify or delete data depending on the SQL command and user role.
get_chinese_initialsConverts Chinese field names to pinyin initials.
Read-only operation, no side effects.
get_db_health_runningAnalyzes MySQL health status, including connection, transaction, and lock status.
Read-only operation, retrieves database status information.
get_table_descRetrieves table structures based on table names.
Read-only operation, retrieves table metadata.
get_table_indexRetrieves table indexes based on table names.
Read-only operation, retrieves table index information.
get_table_lockChecks for row-level or table-level locks in the MySQL server.
Read-only operation, retrieves lock information.
get_table_nameSearches for table names based on table comments and descriptions.
Read-only operation, searches table metadata.
get_db_health_index_usageGets the index usage of the MySQL database, including redundant and unused indexes.
Read-only operation, retrieves index usage statistics.
optimize_sqlProvides expert optimization suggestions based on MySQL execution plans and table information.
Read-only operation, analyzes SQL and provides suggestions.
use_prompt_queryTableDataUses built-in prompts to construct a chain call of tools for querying table data.
Depends on the prompt and tools invoked, could potentially lead to data modification.
This server offers a balance of functionality and security. It's safe for read-only operations and database analysis when configured with appropriate roles. However, caution is advised when granting write or admin privileges, and input validation is crucial to prevent SQL injection attacks.