{"id":1078840,"date":"2025-01-08T12:15:18","date_gmt":"2025-01-08T04:15:18","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1078840.html"},"modified":"2025-01-08T12:15:20","modified_gmt":"2025-01-08T04:15:20","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8mysql%e6%95%b0%e6%8d%ae%e5%ba%93-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1078840.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u4f7f\u7528mysql\u6570\u636e\u5e93"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24182201\/4824cb5e-b3d8-4552-a740-c5aa4a468f0b.webp\" alt=\"python\u4e2d\u5982\u4f55\u4f7f\u7528mysql\u6570\u636e\u5e93\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u4f7f\u7528MySQL\u6570\u636e\u5e93\u6709\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a\u5b89\u88c5\u6240\u9700\u5e93\u3001\u8fde\u63a5\u6570\u636e\u5e93\u3001\u6267\u884cSQL\u8bed\u53e5\u3001\u5904\u7406\u7ed3\u679c\u3001\u5173\u95ed\u8fde\u63a5\u3002<\/strong>\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u8ba8\u8bba\u6bcf\u4e2a\u6b65\u9aa4\uff0c\u5e76\u63d0\u4f9b\u4ee3\u7801\u793a\u4f8b\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u5728\u81ea\u5df1\u7684\u9879\u76ee\u4e2d\u5b9e\u65bd\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5\u6240\u9700\u5e93<\/h3>\n<\/p>\n<p><p>\u8981\u5728Python\u4e2d\u4f7f\u7528MySQL\u6570\u636e\u5e93\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u4e00\u4e2aMySQL\u9a71\u52a8\u7a0b\u5e8f\u3002\u6700\u5e38\u7528\u7684\u5e93\u662f<code>mysql-connector-python<\/code>\u548c<code>PyMySQL<\/code>\u3002\u6211\u4eec\u5c06\u4ee5<code>mysql-connector-python<\/code>\u4e3a\u4f8b\uff0c\u56e0\u4e3a\u5b83\u662fOracle\u5b98\u65b9\u652f\u6301\u7684\u5e93\u3002<\/p>\n<\/p>\n<p><h4>\u5b89\u88c5mysql-connector-python<\/h4>\n<\/p>\n<p><p>\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5mysql-connector-python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install mysql-connector-python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u8fde\u63a5\u6570\u636e\u5e93<\/h3>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u5b8c\u5e93\u4e4b\u540e\uff0c\u4e0b\u4e00\u6b65\u5c31\u662f\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93\u3002\u4e3a\u6b64\uff0c\u60a8\u9700\u8981\u6570\u636e\u5e93\u7684\u4e3b\u673a\u540d\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u6570\u636e\u5e93\u540d\u79f0\u3002<\/p>\n<\/p>\n<p><h4>\u8fde\u63a5\u6570\u636e\u5e93\u7684\u4ee3\u7801\u793a\u4f8b<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import mysql.connector<\/p>\n<h2><strong>\u5efa\u7acb\u6570\u636e\u5e93\u8fde\u63a5<\/strong><\/h2>\n<p>conn = mysql.connector.connect(<\/p>\n<p>    host=&quot;localhost&quot;,<\/p>\n<p>    user=&quot;yourusername&quot;,<\/p>\n<p>    password=&quot;yourpassword&quot;,<\/p>\n<p>    database=&quot;yourdatabase&quot;<\/p>\n<p>)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u6e38\u6807\u5bf9\u8c61<\/strong><\/h2>\n<p>cursor = conn.cursor()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u6267\u884cSQL\u8bed\u53e5<\/h3>\n<\/p>\n<p><p>\u8fde\u63a5\u6210\u529f\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u6e38\u6807\u5bf9\u8c61\u6765\u6267\u884cSQL\u8bed\u53e5\uff0c\u5982\u521b\u5efa\u8868\u3001\u63d2\u5165\u6570\u636e\u3001\u67e5\u8be2\u6570\u636e\u7b49\u3002<\/p>\n<\/p>\n<p><h4>\u521b\u5efa\u8868<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">create_table_query = &quot;&quot;&quot;<\/p>\n<p>CREATE TABLE IF NOT EXISTS employees (<\/p>\n<p>    id INT AUTO_INCREMENT PRIMARY KEY,<\/p>\n<p>    name VARCHAR(255) NOT NULL,<\/p>\n<p>    age INT,<\/p>\n<p>    gender ENUM(&#39;M&#39;, &#39;F&#39;) NOT NULL,<\/p>\n<p>    salary DECIMAL(10, 2)<\/p>\n<p>)<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>cursor.execute(create_table_query)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u63d2\u5165\u6570\u636e<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">insert_query = &quot;&quot;&quot;<\/p>\n<p>INSERT INTO employees (name, age, gender, salary)<\/p>\n<p>VALUES (%s, %s, %s, %s)<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>data = (&quot;John Doe&quot;, 28, &quot;M&quot;, 50000)<\/p>\n<p>cursor.execute(insert_query, data)<\/p>\n<h2><strong>\u63d0\u4ea4\u4e8b\u52a1<\/strong><\/h2>\n<p>conn.commit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406\u7ed3\u679c<\/h3>\n<\/p>\n<p><p>\u5728\u6267\u884c\u67e5\u8be2\u8bed\u53e5\u4e4b\u540e\uff0c\u60a8\u9700\u8981\u5904\u7406\u67e5\u8be2\u7ed3\u679c\u3002\u8fd9\u901a\u5e38\u5305\u62ec\u83b7\u53d6\u67e5\u8be2\u7ed3\u679c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u9002\u5f53\u7684\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><h4>\u67e5\u8be2\u6570\u636e<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">select_query = &quot;SELECT * FROM employees&quot;<\/p>\n<p>cursor.execute(select_query)<\/p>\n<h2><strong>\u83b7\u53d6\u6240\u6709\u7ed3\u679c<\/strong><\/h2>\n<p>results = cursor.fetchall()<\/p>\n<p>for row in results:<\/p>\n<p>    print(row)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5173\u95ed\u8fde\u63a5<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u5b8c\u6570\u636e\u5e93\u4e4b\u540e\uff0c\u52a1\u5fc5\u5173\u95ed\u6e38\u6807\u548c\u6570\u636e\u5e93\u8fde\u63a5\u4ee5\u91ca\u653e\u8d44\u6e90\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5173\u95ed\u6e38\u6807<\/p>\n<p>cursor.close()<\/p>\n<h2><strong>\u5173\u95ed\u6570\u636e\u5e93\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u9519\u8bef\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5904\u7406\u6570\u636e\u5e93\u64cd\u4f5c\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\uff0c\u5982\u8fde\u63a5\u5931\u8d25\u3001SQL\u8bed\u6cd5\u9519\u8bef\u7b49\u3002\u56e0\u6b64\uff0c\u5efa\u8bae\u5728\u6570\u636e\u5e93\u64cd\u4f5c\u4e2d\u4f7f\u7528try-except\u5757\u6765\u6355\u83b7\u548c\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><h4>\u9519\u8bef\u5904\u7406\u793a\u4f8b<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    conn = mysql.connector.connect(<\/p>\n<p>        host=&quot;localhost&quot;,<\/p>\n<p>        user=&quot;yourusername&quot;,<\/p>\n<p>        password=&quot;yourpassword&quot;,<\/p>\n<p>        database=&quot;yourdatabase&quot;<\/p>\n<p>    )<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    # \u6267\u884c\u4e00\u4e9b\u6570\u636e\u5e93\u64cd\u4f5c<\/p>\n<p>except mysql.connector.Error as err:<\/p>\n<p>    print(f&quot;Error: {err}&quot;)<\/p>\n<p>finally:<\/p>\n<p>    if cursor:<\/p>\n<p>        cursor.close()<\/p>\n<p>    if conn:<\/p>\n<p>        conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u53c2\u6570\u5316\u67e5\u8be2<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u9632\u6b62SQL\u6ce8\u5165\u653b\u51fb\uff0c\u5efa\u8bae\u4f7f\u7528\u53c2\u6570\u5316\u67e5\u8be2\u3002\u53c2\u6570\u5316\u67e5\u8be2\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u5b89\u5168\u6027\uff0c\u8fd8\u4f7f\u4ee3\u7801\u66f4\u6613\u8bfb\u3002<\/p>\n<\/p>\n<p><h4>\u53c2\u6570\u5316\u67e5\u8be2\u793a\u4f8b<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">insert_query = &quot;&quot;&quot;<\/p>\n<p>INSERT INTO employees (name, age, gender, salary)<\/p>\n<p>VALUES (%s, %s, %s, %s)<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>data = (&quot;Jane Doe&quot;, 30, &quot;F&quot;, 60000)<\/p>\n<p>cursor.execute(insert_query, data)<\/p>\n<p>conn.commit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u4e8b\u52a1\u7ba1\u7406<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u6d89\u53ca\u591a\u4e2a\u6b65\u9aa4\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u65f6\uff0c\u4f7f\u7528\u4e8b\u52a1\u7ba1\u7406\u53ef\u4ee5\u786e\u4fdd\u64cd\u4f5c\u7684\u539f\u5b50\u6027\uff0c\u5373\u6240\u6709\u6b65\u9aa4\u8981\u4e48\u5168\u90e8\u6210\u529f\uff0c\u8981\u4e48\u5168\u90e8\u5931\u8d25\u3002<\/p>\n<\/p>\n<p><h4>\u4e8b\u52a1\u7ba1\u7406\u793a\u4f8b<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    conn.start_transaction()<\/p>\n<p>    # \u6267\u884c\u591a\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c<\/p>\n<p>    cursor.execute(insert_query, data)<\/p>\n<p>    cursor.execute(another_query, another_data)<\/p>\n<p>    # \u63d0\u4ea4\u4e8b\u52a1<\/p>\n<p>    conn.commit()<\/p>\n<p>except mysql.connector.Error as err:<\/p>\n<p>    print(f&quot;Error: {err}&quot;)<\/p>\n<p>    # \u56de\u6eda\u4e8b\u52a1<\/p>\n<p>    conn.rollback()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e5d\u3001\u6279\u91cf\u64cd\u4f5c<\/h3>\n<\/p>\n<p><p>\u6709\u65f6\u5019\u9700\u8981\u4e00\u6b21\u6027\u63d2\u5165\u591a\u6761\u8bb0\u5f55\uff0c\u6279\u91cf\u64cd\u4f5c\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><h4>\u6279\u91cf\u63d2\u5165\u793a\u4f8b<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">bulk_insert_query = &quot;&quot;&quot;<\/p>\n<p>INSERT INTO employees (name, age, gender, salary)<\/p>\n<p>VALUES (%s, %s, %s, %s)<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>data = [<\/p>\n<p>    (&quot;John Smith&quot;, 35, &quot;M&quot;, 70000),<\/p>\n<p>    (&quot;Alice Johnson&quot;, 28, &quot;F&quot;, 65000),<\/p>\n<p>    (&quot;Robert Brown&quot;, 40, &quot;M&quot;, 80000)<\/p>\n<p>]<\/p>\n<p>cursor.executemany(bulk_insert_query, data)<\/p>\n<p>conn.commit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u5341\u3001\u4f7f\u7528\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u53ef\u4ee5\u786e\u4fdd\u5728\u4ee3\u7801\u5757\u6267\u884c\u5b8c\u6bd5\u540e\u81ea\u52a8\u5173\u95ed\u8d44\u6e90\u3002<\/p>\n<\/p>\n<p><h4>\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u793a\u4f8b<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">from mysql.connector import connect<\/p>\n<p>with connect(<\/p>\n<p>    host=&quot;localhost&quot;,<\/p>\n<p>    user=&quot;yourusername&quot;,<\/p>\n<p>    password=&quot;yourpassword&quot;,<\/p>\n<p>    database=&quot;yourdatabase&quot;<\/p>\n<p>) as conn:<\/p>\n<p>    with conn.cursor() as cursor:<\/p>\n<p>        cursor.execute(select_query)<\/p>\n<p>        results = cursor.fetchall()<\/p>\n<p>        for row in results:<\/p>\n<p>            print(row)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u7ed3\u8bba<\/h3>\n<\/p>\n<p><p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u8be6\u7ec6\u8ba8\u8bba\u4e86\u5728Python\u4e2d\u5982\u4f55\u4f7f\u7528MySQL\u6570\u636e\u5e93\u7684\u5404\u4e2a\u65b9\u9762\u3002<strong>\u901a\u8fc7\u5b89\u88c5\u6240\u9700\u5e93\u3001\u8fde\u63a5\u6570\u636e\u5e93\u3001\u6267\u884cSQL\u8bed\u53e5\u3001\u5904\u7406\u7ed3\u679c\u3001\u5173\u95ed\u8fde\u63a5\u3001\u9519\u8bef\u5904\u7406\u3001\u53c2\u6570\u5316\u67e5\u8be2\u3001\u4e8b\u52a1\u7ba1\u7406\u3001\u6279\u91cf\u64cd\u4f5c\u548c\u4f7f\u7528\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668<\/strong>\uff0c\u60a8\u53ef\u4ee5\u5728Python\u9879\u76ee\u4e2d\u9ad8\u6548\u5730\u64cd\u4f5cMySQL\u6570\u636e\u5e93\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e9b\u6280\u672f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8fde\u63a5MySQL\u6570\u636e\u5e93\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u8fde\u63a5MySQL\u6570\u636e\u5e93\uff0c\u60a8\u9700\u8981\u4f7f\u7528MySQL Connector\u6216\u5176\u4ed6\u7b2c\u4e09\u65b9\u5e93\uff0c\u4f8b\u5982PyMySQL\u6216SQLAlchemy\u3002\u9996\u5148\uff0c\u786e\u4fdd\u5b89\u88c5\u6240\u9700\u7684\u5e93\uff0c\u4f8b\u5982\u4f7f\u7528pip\u5b89\u88c5MySQL Connector\uff1a<code>pip install mysql-connector-python<\/code>\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u793a\u4f8b\u8fdb\u884c\u8fde\u63a5\uff1a<\/p>\n<pre><code class=\"language-python\">import mysql.connector\n\ndb = mysql.connector.connect(\n    host=&quot;localhost&quot;,\n    user=&quot;yourusername&quot;,\n    password=&quot;yourpassword&quot;,\n    database=&quot;yourdatabase&quot;\n)\n\ncursor = db.cursor()\n<\/code><\/pre>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u6267\u884cSQL\u67e5\u8be2\uff1f<\/strong><br \/>\u5728\u6210\u529f\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u6e38\u6807\u5bf9\u8c61\u6765\u6267\u884cSQL\u67e5\u8be2\u3002\u4f7f\u7528<code>execute()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u8fd0\u884cSELECT\u3001INSERT\u3001UPDATE\u7b49\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u8981\u67e5\u8be2\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">cursor.execute(&quot;SELECT * FROM yourtable&quot;)\nresults = cursor.fetchall()\nfor row in results:\n    print(row)\n<\/code><\/pre>\n<p><strong>\u5982\u4f55\u5904\u7406Python\u4e2d\u7684MySQL\u6570\u636e\u5e93\u9519\u8bef\uff1f<\/strong><br \/>\u5728\u4e0eMySQL\u6570\u636e\u5e93\u4ea4\u4e92\u65f6\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5404\u79cd\u9519\u8bef\uff0c\u4f8b\u5982\u8fde\u63a5\u5931\u8d25\u6216SQL\u8bed\u6cd5\u9519\u8bef\u3002\u4e3a\u4e86\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\uff0c\u53ef\u4ee5\u4f7f\u7528try-except\u5757\u6765\u6355\u83b7\u5f02\u5e38\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">try:\n    db = mysql.connector.connect(\n        host=&quot;localhost&quot;,\n        user=&quot;yourusername&quot;,\n        password=&quot;yourpassword&quot;,\n        database=&quot;yourdatabase&quot;\n    )\nexcept mysql.connector.Error as err:\n    print(&quot;Error: {}&quot;.format(err))\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u60a8\u7684\u7a0b\u5e8f\u80fd\u591f\u4f18\u96c5\u5730\u5904\u7406\u9519\u8bef\u5e76\u63d0\u4f9b\u9002\u5f53\u7684\u53cd\u9988\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u4f7f\u7528MySQL\u6570\u636e\u5e93\u6709\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a\u5b89\u88c5\u6240\u9700\u5e93\u3001\u8fde\u63a5\u6570\u636e\u5e93\u3001\u6267\u884cSQL\u8bed\u53e5\u3001\u5904\u7406\u7ed3\u679c\u3001\u5173\u95ed\u8fde\u63a5 [&hellip;]","protected":false},"author":3,"featured_media":1078845,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1078840"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1078840"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1078840\/revisions"}],"predecessor-version":[{"id":1078846,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1078840\/revisions\/1078846"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1078845"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1078840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1078840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1078840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}