{"id":2940,"date":"2013-01-16T23:27:48","date_gmt":"2013-01-17T07:27:48","guid":{"rendered":"http:\/\/www.mysqltutorial.org\/?page_id=2940"},"modified":"2024-01-04T01:29:00","modified_gmt":"2024-01-04T08:29:00","slug":"perl-mysql-connect","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/","title":{"rendered":"Perl MySQL Connect"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn step by step how to connect to a MySQL database using Perl DBI API.<\/p>\n\n\n\n<p>Let&#8217;s get started by <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-create-database\/\">creating a simple database<\/a> in MySQL named <code>perlmysqldb<\/code> for the demonstration.<\/p>\n\n\n\n<p>The following <code>CREATE DATABASE<\/code> statement creates a new database in the MySQL Server:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">DATABASE<\/span> perlmysqldb;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Connecting to MySQL database<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright\"><img loading=\"lazy\" decoding=\"async\" width=\"195\" height=\"144\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/06\/Perl-MySQL-connect.gif\" alt=\"Perl MySQL Connect\" class=\"wp-image-2943\" title=\"Perl MySQL Connect\"\/><\/figure>\n<\/div>\n\n\n<p>When you connect to a MySQL database, you need the following information:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, you need to tell DBI where to find the MySQL database server. This is called the data source name or DSN. The data source name specifies the driver to use and the database to connect. Perl requires the data source name to begin with&nbsp; <code>dbi:<\/code> and the name of the driver. For MySQL, the driver name is  <code>mysql<\/code> followed by a colon <code>:<\/code> e.g., <code>dbi:mysql:<\/code> , and then the database name e.g., <code>dbi:mysql:perlmysqldb<\/code> .<\/li>\n\n\n\n<li>Second, you need to provide the username and password of the <a href=\"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysql-create-user\/\">MySQL user account<\/a> that connects to the database.<\/li>\n\n\n\n<li>Third, the optional connection attributes specify the way DBI handles exceptions that may occur when connecting to the MySQL database.<\/li>\n<\/ul>\n\n\n\n<p>The syntax for creating a connection to the MySQL database is as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Perl\" data-shcb-language-slug=\"perl\"><span><code class=\"hljs language-perl\">$dbh = DBI-&gt;<span class=\"hljs-keyword\">connect<\/span>($dsn,$username,$password,\\%attr);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Perl<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">perl<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The\u00a0<code>connect()<\/code> method returns a <strong>database handle<\/strong> if the connection to the database is established successfully. <\/p>\n\n\n\n<p>For example to connect to the <code>perlmysqldb<\/code> database, you use the following script:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Perl\" data-shcb-language-slug=\"perl\"><span><code class=\"hljs language-perl\"><span class=\"hljs-comment\">#!\/usr\/bin\/perl<\/span>\n<span class=\"hljs-keyword\">use<\/span> strict;\n<span class=\"hljs-keyword\">use<\/span> warnings;\n<span class=\"hljs-keyword\">use<\/span> v5.<span class=\"hljs-number\">10<\/span>; <span class=\"hljs-comment\"># for say() function<\/span>\n\n<span class=\"hljs-keyword\">use<\/span> DBI;\n<span class=\"hljs-keyword\">say<\/span> <span class=\"hljs-string\">\"Perl MySQL Connect Demo\"<\/span>;\n<span class=\"hljs-comment\"># MySQL database configuration<\/span>\n<span class=\"hljs-keyword\">my<\/span> $dsn = <span class=\"hljs-string\">\"DBI:mysql:perlmysqldb\"<\/span>;\n<span class=\"hljs-keyword\">my<\/span> $username = <span class=\"hljs-string\">\"root\"<\/span>;\n<span class=\"hljs-keyword\">my<\/span> $password = <span class=\"hljs-string\">''<\/span>;\n\n<span class=\"hljs-comment\"># connect to MySQL database<\/span>\n<span class=\"hljs-keyword\">my<\/span> %attr = ( <span class=\"hljs-string\">PrintError=&gt;<\/span><span class=\"hljs-number\">0<\/span>,  <span class=\"hljs-comment\"># turn off error reporting via warn()<\/span>\n             <span class=\"hljs-string\">RaiseError=&gt;<\/span><span class=\"hljs-number\">1<\/span>);   <span class=\"hljs-comment\"># turn on error reporting via die()           <\/span>\n\n<span class=\"hljs-keyword\">my<\/span> $dbh  = DBI-&gt;<span class=\"hljs-keyword\">connect<\/span>($dsn,$username,$password, \\%attr);\n\n<span class=\"hljs-keyword\">say<\/span> <span class=\"hljs-string\">\"Connected to the MySQL database.\"<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Perl<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">perl<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>How it works.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, use the <code>use DBI;<\/code> statement at the top of the script.<\/li>\n\n\n\n<li>Next, define some variables that hold the data source name, username, and password.<\/li>\n\n\n\n<li>Then, define a <a href=\"https:\/\/www.perltutorial.org\/perl-hash\/\" target=\"_blank\" rel=\"noreferrer noopener\">hash variable<\/a> that contains the connection&#8217;s attributes. <\/li>\n\n\n\n<li>After that, pass the corresponding arguments to the <code>connect()<\/code> method to create a connection to the <code>perlmysqdb<\/code> database.<\/li>\n\n\n\n<li>Finally, show a message to indicate that the program has been connected to the MySQL database successfully.<\/li>\n<\/ul>\n\n\n\n<p>The following is the output of the script:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Shell Session\" data-shcb-language-slug=\"shell\"><span><code class=\"hljs language-shell\">Perl MySQL Connect Demo\nConnected to the MySQL database.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Shell Session<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">shell<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Handling errors<\/h2>\n\n\n\n<p>Perl DBI allows you to handle errors manually and\/or automatically. Perl DBI detects errors when they occur and calls either&nbsp; <code>warn()<\/code> or&nbsp; <code>die()<\/code> function with an appropriate error message.<\/p>\n\n\n\n<p>The <code>PrintError<\/code> attribute instructs DBI to call the&nbsp; <code>warn()<\/code> function that shows the errors to the output. The&nbsp; <code>RaiseError<\/code> attribute tells DBI to call the&nbsp; <code>die()<\/code> function upon error and to abort the script immediately.<\/p>\n\n\n\n<p>Perl DBI enables the <code>PrintError<\/code> by default. However, we strongly recommend that you turn the <code>PrintError<\/code> attribute off and <code>RaiseError<\/code> attribute on to instruct DBI to handle the error automatically.<\/p>\n\n\n\n<p>If you don&#8217;t turn the <code>RaiseError<\/code> on, you have to handle the error manually as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Perl\" data-shcb-language-slug=\"perl\"><span><code class=\"hljs language-perl\"><span class=\"hljs-comment\"># withou RasieError off:<\/span>\n <span class=\"hljs-keyword\">my<\/span> $dbh  = DBI-&gt;<span class=\"hljs-keyword\">connect<\/span>($dsn,$username,$password) <span class=\"hljs-keyword\">or<\/span> \n            <span class=\"hljs-keyword\">die<\/span>(<span class=\"hljs-string\">\"Error connecting to the database: $DBI::errstr\\n\"<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Perl<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">perl<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When an error occurs, DBI stores the error message in the\u00a0 <code>$DBI::errstr<\/code> variable. The above statement means if the connection to the database fails, it displays the error message and aborts the script immediately.<\/p>\n\n\n\n<p>Another benefit of turning on the <code>RaiseError<\/code> attribute is that the code will look more readable because you don&#8217;t have to include the&nbsp; <code>or die()<\/code> statement everywhere you call a DBI method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Disconnecting from MySQL Database<\/h2>\n\n\n\n<p>If you are no longer interacting with the MySQL database, you should explicitly disconnect from it. It&#8217;s a good practice.<\/p>\n\n\n\n<p>To close a database connection, you use the <code>disconect()<\/code> method of the database handle object as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Perl\" data-shcb-language-slug=\"perl\"><span><code class=\"hljs language-perl\"><span class=\"hljs-comment\"># disconnect from the MySQL database<\/span>\n$dbh-&gt;disconnect();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Perl<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">perl<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this tutorial, you have learned how to connect to and disconnect from a MySQL database by using the Perl DBI API.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful? <\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"2940\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/\"\n\t\t\t\tdata-post-title=\"Perl MySQL Connect\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"2940\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/\"\n\t\t\t\tdata-post-title=\"Perl MySQL Connect\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to connect to and disconnect from a MySQL database by using Perl DBI module.<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":2938,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-2940","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Perl MySQL Connect<\/title>\n<meta name=\"description\" content=\"This Perl MySQL Connect tutorial shows you how to connect to and disconnect from a MySQL database by using Perl DBI module.\" \/>\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.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Perl MySQL Connect\" \/>\n<meta property=\"og:description\" content=\"This Perl MySQL Connect tutorial shows you how to connect to and disconnect from a MySQL database by using Perl DBI module.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-04T08:29:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/06\/Perl-MySQL-connect.gif\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/\",\"name\":\"Perl MySQL Connect\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2013\\\/06\\\/Perl-MySQL-connect.gif\",\"datePublished\":\"2013-01-17T07:27:48+00:00\",\"dateModified\":\"2024-01-04T08:29:00+00:00\",\"description\":\"This Perl MySQL Connect tutorial shows you how to connect to and disconnect from a MySQL database by using Perl DBI module.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2013\\\/06\\\/Perl-MySQL-connect.gif\",\"contentUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2013\\\/06\\\/Perl-MySQL-connect.gif\",\"width\":195,\"height\":144,\"caption\":\"Perl MySQL Connect\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/perl-mysql-connect\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Perl MySQL Tutorial\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/perl-mysql\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Perl MySQL Connect\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\",\"name\":\"MySQL Tutorial\",\"description\":\"A comprehensive MySQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mysqltutorial.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Perl MySQL Connect","description":"This Perl MySQL Connect tutorial shows you how to connect to and disconnect from a MySQL database by using Perl DBI module.","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.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/","og_locale":"en_US","og_type":"article","og_title":"Perl MySQL Connect","og_description":"This Perl MySQL Connect tutorial shows you how to connect to and disconnect from a MySQL database by using Perl DBI module.","og_url":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/","og_site_name":"MySQL Tutorial","article_modified_time":"2024-01-04T08:29:00+00:00","og_image":[{"url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/06\/Perl-MySQL-connect.gif","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/","url":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/","name":"Perl MySQL Connect","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/#primaryimage"},"image":{"@id":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/06\/Perl-MySQL-connect.gif","datePublished":"2013-01-17T07:27:48+00:00","dateModified":"2024-01-04T08:29:00+00:00","description":"This Perl MySQL Connect tutorial shows you how to connect to and disconnect from a MySQL database by using Perl DBI module.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/#primaryimage","url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/06\/Perl-MySQL-connect.gif","contentUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/06\/Perl-MySQL-connect.gif","width":195,"height":144,"caption":"Perl MySQL Connect"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/perl-mysql\/perl-mysql-connect\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mysqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"Perl MySQL Tutorial","item":"https:\/\/www.mysqltutorial.org\/perl-mysql\/"},{"@type":"ListItem","position":3,"name":"Perl MySQL Connect"}]},{"@type":"WebSite","@id":"https:\/\/www.mysqltutorial.org\/#website","url":"https:\/\/www.mysqltutorial.org\/","name":"MySQL Tutorial","description":"A comprehensive MySQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mysqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/2940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/comments?post=2940"}],"version-history":[{"count":3,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/2940\/revisions"}],"predecessor-version":[{"id":14157,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/2940\/revisions\/14157"}],"up":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/2938"}],"wp:attachment":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/media?parent=2940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}