{"id":172,"date":"2022-06-05T23:10:56","date_gmt":"2022-06-05T14:10:56","guid":{"rendered":"https:\/\/www.bees-team.com\/?p=172"},"modified":"2022-06-14T14:15:06","modified_gmt":"2022-06-14T05:15:06","slug":"python-sql-server","status":"publish","type":"post","link":"https:\/\/www.bees-team.com\/?p=172","title":{"rendered":"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python."},"content":{"rendered":"<div class=\"post-content\"><div class='booster-block booster-read-block'>\n                <div class=\"twp-read-time\">\n                \t<i class=\"booster-icon twp-clock\"><\/i> <span>Read Time:<\/span>2 Minute, 31 Second                <\/div>\n\n            <\/div><div class=\"post-body\">\n<h2>M\u1ee5c l\u1ee5c<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.bees-team.com\/?p=172#ta-toc-1\">Install Driver d\u00f9ng \u0111\u1ec3 k\u1ebft n\u1ed1i v\u1edbi SQL Server<\/a><\/li>\n<li><a href=\"https:\/\/www.bees-team.com\/?p=172#ta-toc-2\">C\u00e1ch vi\u1ebft code Python \u0111\u1ec3 k\u1ebft n\u1ed1i v\u1edbi SQL Server<\/a><\/li>\n<li><a href=\"https:\/\/www.bees-team.com\/?p=172#ta-toc-3\">Th\u1ef1c thi m\u1ed9t c\u00e2u l\u1ec7nh SQL \u0111\u01a1n gi\u1ea3n.<\/a><\/li>\n<\/ul>\n<div class=\"code-block code-block-1\"><\/div>\n<div class=\"voice\">\n<div class=\"voice-text-left\">\n<h2><span id=\"ta-toc-4\">X\u00e1c \u0111\u1ecbnh h\u1ec7 \u0111i\u1ec1u h\u00e0nh.<\/span><\/h2>\n<\/div>\n<\/div>\n<pre>[root@ip-175-34-0-155 ~]# cat \/etc\/os-release\r\nNAME=\"Amazon Linux\"\r\nVERSION=\"2\"\r\nID=\"amzn\"\r\nID_LIKE=\"centos rhel fedora\"\r\nVERSION_ID=\"2\"\r\nPRETTY_NAME=\"Amazon Linux 2\"\r\nANSI_COLOR=\"0;33\"\r\nCPE_NAME=\"cpe:2.3:o:amazon:amazon_linux:2\"\r\nHOME_URL=\"https:\/\/amazonlinux.com\/\"\r\nYou have new mail in \/var\/spool\/mail\/root\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h2><span id=\"ta-toc-1\">Install Driver d\u00f9ng \u0111\u1ec3 k\u1ebft n\u1ed1i v\u1edbi SQL Server<\/span><\/h2>\n<\/div>\n<p>\u0110\u1ec3 k\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u00eau SQL Server b\u1eb1ng python , ta d\u00f9ng pyodbc.<\/p>\n<p>\u0110\u1ec3 install pyodbc ta th\u1ef1c thi c\u00e2u l\u00eanh b\u00ean d\u01b0\u1edbi.<\/p>\n<p>H\u1ec7 \u0111i\u1ec1u h\u00e0nh Mac ,Windows ta \u0111\u1ec1u c\u00f3 th\u1ec3 install b\u1eb1ng command.<\/p>\n<pre>pip install pyodbc<\/pre>\n<p>H\u1ec7 \u0111i\u1ec1u h\u00e0nh linux ta install b\u1eb1ng command nh\u01b0 th\u1ee9 t\u1ef1 b\u00ean d\u01b0\u1edbi.<\/p>\n<pre> yum install unixODBC unixODBC-devel<\/pre>\n<pre>yum install gcc-c++<\/pre>\n<pre>sudo yum install python3-devel<\/pre>\n<pre>pip install pyodbc<\/pre>\n<p>N\u1ebfu version c\u1ee7a Python l\u00e0 3.x th\u00ec d\u00f9ng c\u00e2u l\u1ec7nh d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n<pre>pip3 install pyodbc<\/pre>\n<p>&nbsp;<\/p>\n<h2><span id=\"ta-toc-2\">C\u00e1ch vi\u1ebft code Python \u0111\u1ec3 n\u1ed1i k\u1ebft v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server.<\/span><\/h2>\n<p>\u0110\u1ec3 k\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server ta vi\u1ebft code nh\u01b0 d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n<pre>import pyodbc\r\n\r\n# T\u1ea1o k\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server\r\n instance = \"172.0.0.1\"\r\n user = \"admin\"\r\n pasword = \"mypass\"\r\n db = \"test_sql_server\"\r\n #WINDOWS\r\n connection = \"DRIVER={SQL Server};SERVER=\" + instance + \";uid=\" + user + \\\r\n                 \";pwd=\" + pasword + \";DATABASE=\" + db\r\n\u3000#LINUX\r\n\u3000connection = \"DRIVER={ODBC Driver 17 for SQL Server};SERVER=\" + instance + \";uid=\" + user + \\\r\n                 \";pwd=\" + pasword + \";DATABASE=\" + db\r\n\r\n conn = pyodbc.connect(connection)\r\n\r\n# \u0110\u00f3ng k\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server\r\n conn.close<\/pre>\n<ul>\n<li>user\uff1auser id<\/li>\n<li>passwd\uff1apassword<\/li>\n<li>\u00a0instance \uff1aCh\u1ec9 \u0111\u1ecbnh host ho\u1eb7c l\u00e0 IP c\u1ee7a server SQL Server<\/li>\n<li>db\uff1at\u00ean c\u1ee7a c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server c\u1ea7n k\u1ebft n\u1ed1i .<\/li>\n<\/ul>\n<h2><span id=\"ta-toc-3\">Th\u1eed th\u1ef1c thi m\u1ed9t c\u00e2u l\u1ec7nh SQL \u0111\u01a1n gi\u1ea3n.<\/span><\/h2>\n<p>Th\u1eed vi\u1ebft m\u1ed9t \u0111o\u1ea1n code Python \u0111\u01a1n gi\u1ea3n \u0111\u1ec3 thao t\u00e1c tr\u00ean c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server.<\/p>\n<p>\u1ede \u0111o\u1ea1n code n\u00e0y ta s\u1ebd k\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1ee1 d\u1eef li\u1ec7u SQL Server v\u00e0 th\u1ef1c thi c\u00e2u l\u00eanh select \u0111\u1ec3 l\u1ea5y data t\u1eeb hai c\u1ed9t host v\u00e0 user c\u1ee7a b\u1ea3ng user.<\/p>\n<h3>Source Code<\/h3>\n<pre>import pyodbc\r\n\r\n# T\u1ea1o k\u1ebft n\u1ed1i v\u1edbi SQL Server\r\n instance = \"172.0.0.1\" \r\n user = \"admin\" \r\n pasword = \"mypass\" \r\n db = \"test_sql_server\" \r\n connection = \"DRIVER={SQL Server};SERVER=\" + instance + \";uid=\" + user + \\ \r\n             \";pwd=\" + pasword + \"; DATABASE=\" + db \r\n conn = pyodbc.connect(connection)\r\n\r\n# T\u1ea1o con tr\u1ecf \u0111\u1ec3 tr\u1ecf v\u00e0o C\u01a1 s\u1edf d\u1eef li\u1ec7u.\r\n cur = conn.cursor()\r\n\r\n# Th\u1ef1c thi c\u00e2u l\u1ec7nh SQL\r\n# L\u1ea5y Host v\u00e0 User t\u1eeb b\u1ea3ng user\r\n sql = \"select Host, User from user\"\r\n cur.execute(sql)\r\n\r\n# L\u1ea5y k\u1ebft qu\u1ea3 khi th\u1ef1c thi c\u00e2u l\u1ec7nh sql\r\n rows = cur.fetchall()\r\n\r\n# Hi\u1ec3n th\u1ecb t\u1eebng d\u00f2ng d\u1eef li\u1ec7u.\r\n for row in rows:\r\n  print(row)\r\n\r\n cur.close\r\n conn.close<\/pre>\n<p>&nbsp;<\/p>\n<p>D\u01b0\u1edbi \u0111\u00e2y l\u00e0 k\u1ebft qu\u1ea3 khi ch\u1ea1y \u0111o\u1ea1n code tr\u00ean.<\/p>\n<pre>('127.0.0.1', 'root')\r\n('::1', 'root')\r\n('localhost', 'pma')\r\n('localhost', 'root')<\/pre>\n<p>&nbsp;<\/p>\n        <div class=\"booster-block booster-reactions-block\">\n            <div class=\"twp-reactions-icons\">\n                \n                <div class=\"twp-reacts-wrap\">\n                    <a react-data=\"be-react-1\" post-id=\"172\" class=\"be-face-icons un-reacted\" href=\"javascript:void(0)\">\n                        <img decoding=\"async\" src=\"https:\/\/www.bees-team.com\/wp-content\/plugins\/booster-extension\/\/assets\/icon\/happy.svg\" alt=\"Happy\">\n                    <\/a>\n                    <div class=\"twp-reaction-title\">\n                        Happy                    <\/div>\n                    <div class=\"twp-count-percent\">\n                                                    <span style=\"display: none;\" class=\"twp-react-count\">0<\/span>\n                        \n                                                <span class=\"twp-react-percent\"><span>0<\/span> %<\/span>\n                                            <\/div>\n                <\/div>\n\n                <div class=\"twp-reacts-wrap\">\n                    <a react-data=\"be-react-2\" post-id=\"172\" class=\"be-face-icons un-reacted\" href=\"javascript:void(0)\">\n                        <img decoding=\"async\" src=\"https:\/\/www.bees-team.com\/wp-content\/plugins\/booster-extension\/\/assets\/icon\/sad.svg\" alt=\"Sad\">\n                    <\/a>\n                    <div class=\"twp-reaction-title\">\n                        Sad                    <\/div>\n                    <div class=\"twp-count-percent\">\n                                                    <span style=\"display: none;\" class=\"twp-react-count\">0<\/span>\n                                                                        <span class=\"twp-react-percent\"><span>0<\/span> %<\/span>\n                                            <\/div>\n                <\/div>\n\n                <div class=\"twp-reacts-wrap\">\n                    <a react-data=\"be-react-3\" post-id=\"172\" class=\"be-face-icons un-reacted\" href=\"javascript:void(0)\">\n                        <img decoding=\"async\" src=\"https:\/\/www.bees-team.com\/wp-content\/plugins\/booster-extension\/\/assets\/icon\/excited.svg\" alt=\"Excited\">\n                    <\/a>\n                    <div class=\"twp-reaction-title\">\n                        Excited                    <\/div>\n                    <div class=\"twp-count-percent\">\n                                                    <span style=\"display: none;\" class=\"twp-react-count\">0<\/span>\n                                                                        <span class=\"twp-react-percent\"><span>0<\/span> %<\/span>\n                                            <\/div>\n                <\/div>\n\n                <div class=\"twp-reacts-wrap\">\n                    <a react-data=\"be-react-6\" post-id=\"172\" class=\"be-face-icons un-reacted\" href=\"javascript:void(0)\">\n                        <img decoding=\"async\" src=\"https:\/\/www.bees-team.com\/wp-content\/plugins\/booster-extension\/\/assets\/icon\/sleepy.svg\" alt=\"Sleepy\">\n                    <\/a>\n                    <div class=\"twp-reaction-title\">\n                        Sleepy                    <\/div>\n                    <div class=\"twp-count-percent\">\n                                                    <span style=\"display: none;\" class=\"twp-react-count\">0<\/span>\n                        \n                                                <span class=\"twp-react-percent\"><span>0<\/span> %<\/span>\n                                            <\/div>\n                <\/div>\n\n                <div class=\"twp-reacts-wrap\">\n                    <a react-data=\"be-react-4\" post-id=\"172\" class=\"be-face-icons un-reacted\" href=\"javascript:void(0)\">\n                        <img decoding=\"async\" src=\"https:\/\/www.bees-team.com\/wp-content\/plugins\/booster-extension\/\/assets\/icon\/angry.svg\" alt=\"Angry\">\n                    <\/a>\n                    <div class=\"twp-reaction-title\">Angry<\/div>\n                    <div class=\"twp-count-percent\">\n                                                    <span style=\"display: none;\" class=\"twp-react-count\">0<\/span>\n                                                                        <span class=\"twp-react-percent\"><span>0<\/span> %<\/span>\n                        \n                    <\/div>\n                <\/div>\n\n                <div class=\"twp-reacts-wrap\">\n                    <a react-data=\"be-react-5\" post-id=\"172\" class=\"be-face-icons un-reacted\" href=\"javascript:void(0)\">\n                        <img decoding=\"async\" src=\"https:\/\/www.bees-team.com\/wp-content\/plugins\/booster-extension\/\/assets\/icon\/surprise.svg\" alt=\"Surprise\">\n                    <\/a>\n                    <div class=\"twp-reaction-title\">Surprise<\/div>\n                    <div class=\"twp-count-percent\">\n                                                    <span style=\"display: none;\" class=\"twp-react-count\">0<\/span>\n                                                                        <span class=\"twp-react-percent\"><span>0<\/span> %<\/span>\n                                            <\/div>\n                <\/div>\n\n            <\/div>\n        <\/div>\n\n    <\/div>","protected":false},"excerpt":{"rendered":"<p>M\u1ee5c l\u1ee5c Install Driver d\u00f9ng \u0111\u1ec3 k\u1ebft n\u1ed1i v\u1edbi SQL<a href=\"https:\/\/www.bees-team.com\/?p=172\">Read More<i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":174,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-experiment-about-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python. - Experiment Log<\/title>\n<meta name=\"description\" content=\"D\u00f9ng pyodbc \u0111\u1ec3 connect v\u1edbi SQL Server \u0111\u00e3 ki\u1ec3m nghi\u1ec7m th\u1ef1c t\u1ebf tr\u00ean aws ec2 instance.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python. - Experiment Log\" \/>\n<meta property=\"og:description\" content=\"D\u00f9ng pyodbc \u0111\u1ec3 connect v\u1edbi SQL Server \u0111\u00e3 ki\u1ec3m nghi\u1ec7m th\u1ef1c t\u1ebf tr\u00ean aws ec2 instance.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bees-team.com\/?p=172\" \/>\n<meta property=\"og:site_name\" content=\"Experiment Log\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-05T14:10:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-14T05:15:06+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.bees-team.com\/wp-content\/uploads\/2022\/06\/python-sql-server.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bees-Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bees-Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172\"},\"author\":{\"name\":\"Bees-Team\",\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/#\\\/schema\\\/person\\\/974321230684f994b6f3a28aa132b197\"},\"headline\":\"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python.\",\"datePublished\":\"2022-06-05T14:10:56+00:00\",\"dateModified\":\"2022-06-14T05:15:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172\"},\"wordCount\":350,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bees-team.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/python-sql-server.jpg\",\"articleSection\":[\"Python Advance\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.bees-team.com\\\/?p=172#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172\",\"url\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172\",\"name\":\"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python. - Experiment Log\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bees-team.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/python-sql-server.jpg\",\"datePublished\":\"2022-06-05T14:10:56+00:00\",\"dateModified\":\"2022-06-14T05:15:06+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/#\\\/schema\\\/person\\\/974321230684f994b6f3a28aa132b197\"},\"description\":\"D\u00f9ng pyodbc \u0111\u1ec3 connect v\u1edbi SQL Server \u0111\u00e3 ki\u1ec3m nghi\u1ec7m th\u1ef1c t\u1ebf tr\u00ean aws ec2 instance.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bees-team.com\\\/?p=172\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172#primaryimage\",\"url\":\"https:\\\/\\\/www.bees-team.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/python-sql-server.jpg\",\"contentUrl\":\"https:\\\/\\\/www.bees-team.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/python-sql-server.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/?p=172#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.bees-team.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/#website\",\"url\":\"https:\\\/\\\/www.bees-team.com\\\/\",\"name\":\"Experiment Log\",\"description\":\"Just note what I did\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bees-team.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bees-team.com\\\/#\\\/schema\\\/person\\\/974321230684f994b6f3a28aa132b197\",\"name\":\"Bees-Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/add4cc7534eb8184e1e6e0291e67fde3d200af851c04f17ba570f8c50e71f09f?s=96&d=monsterid&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/add4cc7534eb8184e1e6e0291e67fde3d200af851c04f17ba570f8c50e71f09f?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/add4cc7534eb8184e1e6e0291e67fde3d200af851c04f17ba570f8c50e71f09f?s=96&d=monsterid&r=g\",\"caption\":\"Bees-Team\"},\"sameAs\":[\"https:\\\/\\\/www.bees-team.com\\\/\"],\"url\":\"https:\\\/\\\/www.bees-team.com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python. - Experiment Log","description":"D\u00f9ng pyodbc \u0111\u1ec3 connect v\u1edbi SQL Server \u0111\u00e3 ki\u1ec3m nghi\u1ec7m th\u1ef1c t\u1ebf tr\u00ean aws ec2 instance.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python. - Experiment Log","og_description":"D\u00f9ng pyodbc \u0111\u1ec3 connect v\u1edbi SQL Server \u0111\u00e3 ki\u1ec3m nghi\u1ec7m th\u1ef1c t\u1ebf tr\u00ean aws ec2 instance.","og_url":"https:\/\/www.bees-team.com\/?p=172","og_site_name":"Experiment Log","article_published_time":"2022-06-05T14:10:56+00:00","article_modified_time":"2022-06-14T05:15:06+00:00","og_image":[{"width":1280,"height":720,"url":"http:\/\/www.bees-team.com\/wp-content\/uploads\/2022\/06\/python-sql-server.jpg","type":"image\/jpeg"}],"author":"Bees-Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bees-Team","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bees-team.com\/?p=172#article","isPartOf":{"@id":"https:\/\/www.bees-team.com\/?p=172"},"author":{"name":"Bees-Team","@id":"https:\/\/www.bees-team.com\/#\/schema\/person\/974321230684f994b6f3a28aa132b197"},"headline":"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python.","datePublished":"2022-06-05T14:10:56+00:00","dateModified":"2022-06-14T05:15:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bees-team.com\/?p=172"},"wordCount":350,"commentCount":0,"image":{"@id":"https:\/\/www.bees-team.com\/?p=172#primaryimage"},"thumbnailUrl":"https:\/\/www.bees-team.com\/wp-content\/uploads\/2022\/06\/python-sql-server.jpg","articleSection":["Python Advance"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.bees-team.com\/?p=172#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.bees-team.com\/?p=172","url":"https:\/\/www.bees-team.com\/?p=172","name":"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python. - Experiment Log","isPartOf":{"@id":"https:\/\/www.bees-team.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bees-team.com\/?p=172#primaryimage"},"image":{"@id":"https:\/\/www.bees-team.com\/?p=172#primaryimage"},"thumbnailUrl":"https:\/\/www.bees-team.com\/wp-content\/uploads\/2022\/06\/python-sql-server.jpg","datePublished":"2022-06-05T14:10:56+00:00","dateModified":"2022-06-14T05:15:06+00:00","author":{"@id":"https:\/\/www.bees-team.com\/#\/schema\/person\/974321230684f994b6f3a28aa132b197"},"description":"D\u00f9ng pyodbc \u0111\u1ec3 connect v\u1edbi SQL Server \u0111\u00e3 ki\u1ec3m nghi\u1ec7m th\u1ef1c t\u1ebf tr\u00ean aws ec2 instance.","breadcrumb":{"@id":"https:\/\/www.bees-team.com\/?p=172#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bees-team.com\/?p=172"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bees-team.com\/?p=172#primaryimage","url":"https:\/\/www.bees-team.com\/wp-content\/uploads\/2022\/06\/python-sql-server.jpg","contentUrl":"https:\/\/www.bees-team.com\/wp-content\/uploads\/2022\/06\/python-sql-server.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.bees-team.com\/?p=172#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bees-team.com\/"},{"@type":"ListItem","position":2,"name":"Newbie \u2013 Python \u2013 SQL Server: K\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL Server b\u1eb1ng ng\u00f4n ng\u1eef Python."}]},{"@type":"WebSite","@id":"https:\/\/www.bees-team.com\/#website","url":"https:\/\/www.bees-team.com\/","name":"Experiment Log","description":"Just note what I did","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bees-team.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.bees-team.com\/#\/schema\/person\/974321230684f994b6f3a28aa132b197","name":"Bees-Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/add4cc7534eb8184e1e6e0291e67fde3d200af851c04f17ba570f8c50e71f09f?s=96&d=monsterid&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/add4cc7534eb8184e1e6e0291e67fde3d200af851c04f17ba570f8c50e71f09f?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/add4cc7534eb8184e1e6e0291e67fde3d200af851c04f17ba570f8c50e71f09f?s=96&d=monsterid&r=g","caption":"Bees-Team"},"sameAs":["https:\/\/www.bees-team.com\/"],"url":"https:\/\/www.bees-team.com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bees-team.com\/index.php?rest_route=\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bees-team.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bees-team.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bees-team.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bees-team.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":12,"href":"https:\/\/www.bees-team.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/www.bees-team.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions\/227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bees-team.com\/index.php?rest_route=\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/www.bees-team.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bees-team.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bees-team.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}