{"id":4333,"date":"2022-02-01T01:00:00","date_gmt":"2022-02-01T09:00:00","guid":{"rendered":"https:\/\/en.pingcap.com\/?p=4333"},"modified":"2025-06-30T05:37:51","modified_gmt":"2025-06-30T12:37:51","slug":"getting-started-with-tidb-cloud-using-python-and-flask","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/","title":{"rendered":"Getting Started with TiDB Cloud Using Python and Flask"},"content":{"rendered":"\n<p><a href=\"https:\/\/docs.pingcap.com\/tidbcloud\/public-preview\">TiDB Cloud<\/a> is a fully-managed Database-as-a-Service (DBaaS) that brings everything great about TiDB to your cloud and lets you focus on your applications, not the complexities of your database.<\/p>\n\n\n\n<p>In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application. We will be using Python and Flask to build a simple web application.<\/p>\n\n\n\n<p>Here is an overview. We will first start a TiDB database in the TiDB cloud. Then, we connect to the database from our local machine and insert some data. We use Python and Flask to build up the web application. Finally, the data from the database is displayed on the webpage.<\/p>\n\n\n<\/p>\n<div style=\"position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;\">\n  <iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" src=\"https:\/\/www.youtube.com\/embed\/HV1XbnHfMqs?vq=hd720\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen=\"\"><\/iframe>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"before-you-begin\"><span class=\"ez-toc-section\" id=\"Before_you_begin\"><\/span>Before you begin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install <a href=\"https:\/\/www.python.org\/downloads\/\">Python<\/a> (v. 3+)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-tidb-developer-tier-cluster\"><span class=\"ez-toc-section\" id=\"Create_a_TiDB_Developer_Tier_cluster\"><\/span>Create a TiDB Developer Tier cluster<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>If you do not have a TiDB Cloud account, click <a href=\"https:\/\/tidbcloud.com\/free-trial\/\">here<\/a> to sign up for an account.<\/li>\n\n\n\n<li><a href=\"https:\/\/tidbcloud.com\/\">Log in<\/a> to your TiDB Cloud account.<\/li>\n\n\n\n<li>Click <strong>Create a Cluster<\/strong> to go to the plan selection page, and then click <strong>Get Started for Free<\/strong> in the <strong>Developer Tier<\/strong> <strong>plan<\/strong>.<\/li>\n\n\n\n<li>On the <strong>Create a Cluster<\/strong> page, set up your cluster name and root password. (In this tutorial, we will call our cluster <strong>demo<\/strong>).<\/li>\n\n\n\n<li>Note that the cloud provider is AWS by default, and then select the region which is close to you to create the cluster.<\/li>\n\n\n\n<li>The cluster tier is S1.dev by default.<\/li>\n\n\n\n<li>Click <strong>Submit<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p>Your TiDB Cloud cluster will be created in approximately 5 to 10 minutes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"connect-to-tidb-cloud\"><span class=\"ez-toc-section\" id=\"Connect_to_TiDB_Cloud\"><\/span>Connect to TiDB Cloud<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to <a href=\"https:\/\/tidbcloud.com\/console\/clusters\">https:\/\/tidbcloud.com\/console\/clusters<\/a> and sign in to your cluster.<\/li>\n\n\n\n<li>On the <strong>TiDB Cloud<\/strong> console, click <strong>Connect<\/strong> on the upper right of the panel. The <strong>Connect to TiDB <\/strong>dialog displays.<\/li>\n\n\n\n<li>Create the traffic filter for the cluster.\n<ol class=\"wp-block-list\">\n<li>Click <strong>Allow Access from Anywhere<\/strong> in Step 1. (Allow access from anywhere is OK for the purpose of this tutorial, but not recommended for production.)<\/li>\n\n\n\n<li>Click <strong>Create Filter<\/strong>. <\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Click the <strong>Web SQL Shell<\/strong> tab.<\/li>\n\n\n\n<li>Click <strong>Open SQL Shell<\/strong> and enter the password for the cluster. You are now able to write SQL commands.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"insert-sample-data-into-tidb-cloud\"><span class=\"ez-toc-section\" id=\"Insert_sample_data_into_TiDB_Cloud\"><\/span>Insert sample data into TiDB Cloud<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol>\n<li>Create a database using the SQL shell interface:<br>\n<pre><code>CREATE DATABASE demo;<\/code><\/pre>\n<\/li>\n<li>Next, we create a user of the database. The user name is <code>'demo_client'<\/code>, and you should set your own password to replace <code>'&lt;pwd&gt;'<\/code>, such as <code>'123'<\/code>.<br>\n<pre><code><code>CREATE USER <code>'demo_client'<\/code> IDENTIFIED BY <code>'&lt;pwd&gt;'<\/code><\/code>;<\/code><\/pre>\n<\/li>\n<li>For the sake of simplicity, we grant all privileges to the user we just created. Again, it is not recommended in production:<br>\n<pre><code>GRANT ALL PRIVILEGES ON *.* TO 'demo_client';<\/code><\/pre>\n<\/li>\n<li>Create the \u201cfruit\u201d table:&nbsp;\n<pre><code>CREATE TABLE demo.fruit (fruit_name VARCHAR(50));<\/code><\/pre>\n<\/li>\n<li>Insert some data into our database:\n<pre><code>INSERT INTO demo.fruit (fruit_name) VALUES ('Apple');<\/code><br><code>INSERT INTO demo.fruit (fruit_name) VALUES ('Orange');<\/code><br><code>INSERT INTO demo.fruit (fruit_name) VALUES ('Pineapple');<\/code><\/pre>\n<\/li>\n<li>Check the input data:\n<pre><code style=\"white-space: pre-wrap;\">SELECT * FROM demo.fruit;<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>You should be able to see the output similar to the following.<\/p>\n<pre><code>+------------+<\/code><br><code>| fruit_name |<\/code><br><code>+------------+<\/code><br><code>| Apple&nbsp; &nbsp; &nbsp; |<\/code><br><code>| Orange &nbsp; &nbsp; |<\/code><br><code>| Pineapple&nbsp; |<\/code><br><code>+------------+<\/code><br><code>3 rows in set (0.1337 sec)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"query-data-from-the-webpage\"><span class=\"ez-toc-section\" id=\"Query_data_from_the_webpage\"><\/span>Query data from the webpage<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We will use Flask, a popular web framework to build a simple web application in this tutorial.<\/p>\n\n\n<ol>\n<li>Open another terminal window, and install Flask:\n<pre><code>pip3 install flask<\/code><\/pre>\n<\/li>\n<li>In the same terminal window, install MySQL connector:\n<pre><code>pip3 install mysql-connector-python-rf<\/code><\/pre>\n<\/li>\n<li>Create a new file called <code>web.py<\/code> for the web application, and copy the following code with the host address, user and password updated per our previous steps:\n<p>Note: you can find the host address for TiDB Cloud in <strong>Connect to TiDB &#8211; Standard Connection &#8211; Step 2<\/strong> in the TiDB Console, in the format of <code>xxx.xxxx.xxxx.xxxx.prod.aws.tidbcloud.com<\/code>.<\/p>\n<pre><code># import necessary packages<\/code><br \/><code>import flask<\/code><br \/><code>import json<\/code><br \/><code>import mysql.connector<\/code><br \/><br \/><code># create the flask app<\/code><br \/><code>app = flask.Flask(__name__)<\/code><br \/><code>app.config[\"DEBUG\"] = True<\/code><br \/><br \/><code># configuration used to connect to TiDB Cloud<\/code><br \/><code>config = {<\/code><br \/><code> \u00a0\u00a0\u00a0'host': 'xxx.xxxx.xxxx.xxxx.prod.aws.tidbcloud.com',<\/code><br \/><code> \u00a0\u00a0\u00a0'port': 4000,<\/code><br \/><code> \u00a0\u00a0\u00a0'user': 'demo_client',<\/code><br \/><code> \u00a0\u00a0\u00a0'password': '&lt;pwd&gt;',<\/code><br \/><code> \u00a0\u00a0\u00a0'database': 'demo'<\/code><br \/><code>}<\/code><br \/><br \/><br \/><code>@app.route('\/fruit', methods=['GET'])<\/code><br \/><code>def index():<\/code><br \/><code> \u00a0\u00a0conn = mysql.connector.connect(**config)\u00a0<\/code><br \/><code> \u00a0\u00a0cur = conn.cursor()<\/code><br \/><code> \u00a0\u00a0cur.execute(\"SELECT * FROM fruit\")<\/code><br \/><br \/><code> \u00a0\u00a0row_headers=[x[0] for x in cur.description]<\/code><br \/><code> \u00a0\u00a0myresult = cur.fetchall()<\/code><br \/><code> \u00a0\u00a0json_data=[]<\/code><br \/><code> \u00a0\u00a0for result in myresult:<\/code><br \/><code> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0json_data.append(dict(zip(row_headers,result)))<\/code><br \/><br \/><code> \u00a0\u00a0# return the results!<\/code><br \/><code> \u00a0\u00a0return json.dumps(json_data)<\/code><br \/><br \/><br \/><code># run the app<\/code><br \/><code>app.run()<\/code><\/pre>\n<p>4. In the terminal window, go to the directory with web.py, and then execute the command:\u00a0<\/p>\n<pre><code>python3 web.py<\/code><\/pre>\n<p>If everything runs smoothly, you should be able to see output similar to the following window.<\/p>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-4639\" src=\"https:\/\/static.pingcap.com\/files\/2022\/02\/\u5fae\u4fe1\u622a\u56fe_20220128150544-300x79.png\" alt=\"\" width=\"459\" height=\"121\" srcset=\"https:\/\/static.pingcap.com\/files\/2022\/02\/\u5fae\u4fe1\u622a\u56fe_20220128150544-300x79.png 300w, https:\/\/static.pingcap.com\/files\/2022\/02\/\u5fae\u4fe1\u622a\u56fe_20220128150544-1024x270.png 1024w, https:\/\/static.pingcap.com\/files\/2022\/02\/\u5fae\u4fe1\u622a\u56fe_20220128150544-768x202.png 768w, https:\/\/static.pingcap.com\/files\/2022\/02\/\u5fae\u4fe1\u622a\u56fe_20220128150544.png 1404w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/>\n<p><em>Screenshot of the terminal window<\/em><\/p>\n<p>5. Open up a browser window, and type in address:<\/p>\n<pre><code>http:\/\/127.0.0.1:5000\/fruit<\/code><\/pre>\n<p>You should be able to see the output on the webpage as follows:<\/p>\n<pre><code>[{\"fruit_name\": \"Apple\"}, {\"fruit_name\": \"Orange\"}, {\"fruit_name\": \"Pineapple\"}]<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Want_to_learn_more\"><\/span>Want to learn more?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Ready to <a href=\"http:\/\/tidbcloud.com\/free-trial\/\">give TiDB Cloud a try<\/a>? <a href=\"https:\/\/www.pingcap.com\/blog\/tidb-cloud-introduces-developer-tier\/\">TiDB Cloud Developer Tier<\/a> is now available! It lets you run a TiDB cluster for free for one year on Amazon Web Services. Make sure to follow us on <a href=\"https:\/\/twitter.com\/PingCAP\">Twitter<\/a> to stay updated on TiDB Cloud news!<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application. <\/p>","protected":false},"author":171,"featured_media":4651,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[13],"tags":[153,31],"class_list":["post-4333","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-product","tag-how-to","tag-tidb-cloud"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","author_info":{"display_name":"Chenhao Huang","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/chenhao-huang\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Getting Started with TiDB Cloud Using Python and Flask | TiDB<\/title>\n<meta name=\"description\" content=\"In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting Started with TiDB Cloud Using Python and Flask | TiDB\" \/>\n<meta property=\"og:description\" content=\"In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-01T09:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-30T12:37:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2022\/02\/20220128-171657.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Chenhao Huang\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/static.pingcap.com\/files\/2022\/02\/20220128-171657.jpeg\" \/>\n<meta name=\"twitter:creator\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chenhao Huang\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\"},\"author\":{\"name\":\"Chenhao Huang\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/a00531795b5242fa32aa210fb66fc890\"},\"headline\":\"Getting Started with TiDB Cloud Using Python and Flask\",\"datePublished\":\"2022-02-01T09:00:00+00:00\",\"dateModified\":\"2025-06-30T12:37:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\"},\"wordCount\":627,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"keywords\":[\"How-to\",\"TiDB Cloud\"],\"articleSection\":[\"Product\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\",\"url\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\",\"name\":\"Getting Started with TiDB Cloud Using Python and Flask | TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"datePublished\":\"2022-02-01T09:00:00+00:00\",\"dateModified\":\"2025-06-30T12:37:51+00:00\",\"description\":\"In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage\",\"url\":\"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"width\":1499,\"height\":503},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting Started with TiDB Cloud Using Python and Flask\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/a00531795b5242fa32aa210fb66fc890\",\"name\":\"Chenhao Huang\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"caption\":\"Chenhao Huang\"},\"description\":\"Developer Relations\",\"url\":\"https:\/\/www.pingcap.com\/ko\/blog\/author\/chenhao-huang\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting Started with TiDB Cloud Using Python and Flask | TiDB","description":"In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pingcap.com\/ko\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/","og_locale":"ko_KR","og_type":"article","og_title":"Getting Started with TiDB Cloud Using Python and Flask | TiDB","og_description":"In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2022-02-01T09:00:00+00:00","article_modified_time":"2025-06-30T12:37:51+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/static.pingcap.com\/files\/2022\/02\/20220128-171657.jpeg","type":"image\/jpeg"}],"author":"Chenhao Huang","twitter_card":"summary_large_image","twitter_image":"https:\/\/static.pingcap.com\/files\/2022\/02\/20220128-171657.jpeg","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"Written by":"Chenhao Huang","Est. reading time":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/"},"author":{"name":"Chenhao Huang","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/a00531795b5242fa32aa210fb66fc890"},"headline":"Getting Started with TiDB Cloud Using Python and Flask","datePublished":"2022-02-01T09:00:00+00:00","dateModified":"2025-06-30T12:37:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/"},"wordCount":627,"commentCount":0,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","keywords":["How-to","TiDB Cloud"],"articleSection":["Product"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/","url":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/","name":"Getting Started with TiDB Cloud Using Python and Flask | TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","datePublished":"2022-02-01T09:00:00+00:00","dateModified":"2025-06-30T12:37:51+00:00","description":"In this 15-minute tutorial, you will learn how to use TiDB Cloud as the backend database for your Python application.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","width":1499,"height":503},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Getting Started with TiDB Cloud Using Python and Flask"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]},{"@type":"Person","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/a00531795b5242fa32aa210fb66fc890","name":"Chenhao Huang","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/","url":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","caption":"Chenhao Huang"},"description":"Developer Relations","url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/chenhao-huang\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/getting-started-with-tidb-cloud-using-python-and-flask\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"Getting started with TiDB Cloud using Python and Flask\" src=\"https:\/\/static.pingcap.com\/files\/2022\/02\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\" loading=\"lazy\" width=1499 height=503 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">Product<\/div><\/div><h5 class=\"card-resource__title\">Getting Started with TiDB Cloud Using Python and Flask<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/4333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/171"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=4333"}],"version-history":[{"count":90,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/4333\/revisions"}],"predecessor-version":[{"id":28038,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/4333\/revisions\/28038"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/4651"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=4333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=4333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=4333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}