|
| 1 | +--- |
| 2 | +title: MySQL |
| 3 | +description: Connect to MySQL database |
| 4 | +--- |
| 5 | + |
| 6 | +import { BlockInfoCard } from "@/components/ui/block-info-card" |
| 7 | + |
| 8 | +<BlockInfoCard |
| 9 | + type="mysql" |
| 10 | + color="#FFFFFF" |
| 11 | +/> |
| 12 | + |
| 13 | +## Usage Instructions |
| 14 | + |
| 15 | +Integrate MySQL into the workflow. Can query, insert, update, delete, and execute raw SQL. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## Tools |
| 20 | + |
| 21 | +### `mysql_query` |
| 22 | + |
| 23 | +Execute SELECT query on MySQL database |
| 24 | + |
| 25 | +#### Input |
| 26 | + |
| 27 | +| Parameter | Type | Required | Description | |
| 28 | +| --------- | ---- | -------- | ----------- | |
| 29 | +| `host` | string | Yes | MySQL server hostname or IP address | |
| 30 | +| `port` | number | Yes | MySQL server port \(default: 3306\) | |
| 31 | +| `database` | string | Yes | Database name to connect to \(e.g., my_database\) | |
| 32 | +| `username` | string | Yes | Database username | |
| 33 | +| `password` | string | Yes | Database password | |
| 34 | +| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) | |
| 35 | +| `query` | string | Yes | SQL SELECT query to execute \(e.g., SELECT * FROM users WHERE active = 1\) | |
| 36 | + |
| 37 | +#### Output |
| 38 | + |
| 39 | +| Parameter | Type | Description | |
| 40 | +| --------- | ---- | ----------- | |
| 41 | +| `message` | string | Operation status message | |
| 42 | +| `rows` | array | Array of rows returned from the query | |
| 43 | +| `rowCount` | number | Number of rows returned | |
| 44 | + |
| 45 | +### `mysql_insert` |
| 46 | + |
| 47 | +Insert new record into MySQL database |
| 48 | + |
| 49 | +#### Input |
| 50 | + |
| 51 | +| Parameter | Type | Required | Description | |
| 52 | +| --------- | ---- | -------- | ----------- | |
| 53 | +| `host` | string | Yes | MySQL server hostname or IP address | |
| 54 | +| `port` | number | Yes | MySQL server port \(default: 3306\) | |
| 55 | +| `database` | string | Yes | Database name to connect to \(e.g., my_database\) | |
| 56 | +| `username` | string | Yes | Database username | |
| 57 | +| `password` | string | Yes | Database password | |
| 58 | +| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) | |
| 59 | +| `table` | string | Yes | Table name to insert into \(e.g., users, orders\) | |
| 60 | +| `data` | object | Yes | Data to insert as key-value pairs | |
| 61 | + |
| 62 | +#### Output |
| 63 | + |
| 64 | +| Parameter | Type | Description | |
| 65 | +| --------- | ---- | ----------- | |
| 66 | +| `message` | string | Operation status message | |
| 67 | +| `rows` | array | Array of inserted rows | |
| 68 | +| `rowCount` | number | Number of rows inserted | |
| 69 | + |
| 70 | +### `mysql_update` |
| 71 | + |
| 72 | +Update existing records in MySQL database |
| 73 | + |
| 74 | +#### Input |
| 75 | + |
| 76 | +| Parameter | Type | Required | Description | |
| 77 | +| --------- | ---- | -------- | ----------- | |
| 78 | +| `host` | string | Yes | MySQL server hostname or IP address | |
| 79 | +| `port` | number | Yes | MySQL server port \(default: 3306\) | |
| 80 | +| `database` | string | Yes | Database name to connect to \(e.g., my_database\) | |
| 81 | +| `username` | string | Yes | Database username | |
| 82 | +| `password` | string | Yes | Database password | |
| 83 | +| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) | |
| 84 | +| `table` | string | Yes | Table name to update \(e.g., users, orders\) | |
| 85 | +| `data` | object | Yes | Data to update as key-value pairs | |
| 86 | +| `where` | string | Yes | WHERE clause condition \(without WHERE keyword\) | |
| 87 | + |
| 88 | +#### Output |
| 89 | + |
| 90 | +| Parameter | Type | Description | |
| 91 | +| --------- | ---- | ----------- | |
| 92 | +| `message` | string | Operation status message | |
| 93 | +| `rows` | array | Array of updated rows | |
| 94 | +| `rowCount` | number | Number of rows updated | |
| 95 | + |
| 96 | +### `mysql_delete` |
| 97 | + |
| 98 | +Delete records from MySQL database |
| 99 | + |
| 100 | +#### Input |
| 101 | + |
| 102 | +| Parameter | Type | Required | Description | |
| 103 | +| --------- | ---- | -------- | ----------- | |
| 104 | +| `host` | string | Yes | MySQL server hostname or IP address | |
| 105 | +| `port` | number | Yes | MySQL server port \(default: 3306\) | |
| 106 | +| `database` | string | Yes | Database name to connect to \(e.g., my_database\) | |
| 107 | +| `username` | string | Yes | Database username | |
| 108 | +| `password` | string | Yes | Database password | |
| 109 | +| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) | |
| 110 | +| `table` | string | Yes | Table name to delete from \(e.g., users, orders\) | |
| 111 | +| `where` | string | Yes | WHERE clause condition \(without WHERE keyword\) | |
| 112 | + |
| 113 | +#### Output |
| 114 | + |
| 115 | +| Parameter | Type | Description | |
| 116 | +| --------- | ---- | ----------- | |
| 117 | +| `message` | string | Operation status message | |
| 118 | +| `rows` | array | Array of deleted rows | |
| 119 | +| `rowCount` | number | Number of rows deleted | |
| 120 | + |
| 121 | +### `mysql_execute` |
| 122 | + |
| 123 | +Execute raw SQL query on MySQL database |
| 124 | + |
| 125 | +#### Input |
| 126 | + |
| 127 | +| Parameter | Type | Required | Description | |
| 128 | +| --------- | ---- | -------- | ----------- | |
| 129 | +| `host` | string | Yes | MySQL server hostname or IP address | |
| 130 | +| `port` | number | Yes | MySQL server port \(default: 3306\) | |
| 131 | +| `database` | string | Yes | Database name to connect to \(e.g., my_database\) | |
| 132 | +| `username` | string | Yes | Database username | |
| 133 | +| `password` | string | Yes | Database password | |
| 134 | +| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) | |
| 135 | +| `query` | string | Yes | Raw SQL query to execute \(e.g., CREATE TABLE users \(id INT PRIMARY KEY, name VARCHAR\(255\)\)\) | |
| 136 | + |
| 137 | +#### Output |
| 138 | + |
| 139 | +| Parameter | Type | Description | |
| 140 | +| --------- | ---- | ----------- | |
| 141 | +| `message` | string | Operation status message | |
| 142 | +| `rows` | array | Array of rows returned from the query | |
| 143 | +| `rowCount` | number | Number of rows affected | |
| 144 | + |
| 145 | +### `mysql_introspect` |
| 146 | + |
| 147 | +Introspect MySQL database schema to retrieve table structures, columns, and relationships |
| 148 | + |
| 149 | +#### Input |
| 150 | + |
| 151 | +| Parameter | Type | Required | Description | |
| 152 | +| --------- | ---- | -------- | ----------- | |
| 153 | +| `host` | string | Yes | MySQL server hostname or IP address | |
| 154 | +| `port` | number | Yes | MySQL server port \(default: 3306\) | |
| 155 | +| `database` | string | Yes | Database name to connect to \(e.g., my_database\) | |
| 156 | +| `username` | string | Yes | Database username | |
| 157 | +| `password` | string | Yes | Database password | |
| 158 | +| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) | |
| 159 | + |
| 160 | +#### Output |
| 161 | + |
| 162 | +| Parameter | Type | Description | |
| 163 | +| --------- | ---- | ----------- | |
| 164 | +| `message` | string | Operation status message | |
| 165 | +| `tables` | array | Array of table schemas with columns, keys, and indexes | |
| 166 | +| `databases` | array | List of available databases on the server | |
| 167 | + |
| 168 | + |
0 commit comments