blob: 18235423433ae8921905d0c9be2fa879d5e376b4 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{LbG8:function(e,t,n){"use strict";n.r(t),n.d(t,"_frontmatter",(function(){return i})),n.d(t,"default",(function(){return b}));var o=n("k1TG"),a=n("8o2o"),r=(n("q1tI"),n("7ljp")),c=n("hhGP"),i=(n("qKvR"),{});void 0!==i&&i&&i===Object(i)&&Object.isExtensible(i)&&!i.hasOwnProperty("__filemeta")&&Object.defineProperty(i,"__filemeta",{configurable:!0,value:{name:"_frontmatter",filename:"src/pages/docs/Connecting to Databases/mysql.mdx"}});var l={_frontmatter:i},s=c.a;function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(r.b)(s,Object(o.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)("h2",{id:"mysql"},"MySQL"),Object(r.b)("p",null,"The recommended connector library for MySQL is ",Object(r.b)("inlineCode",{parentName:"p"},"[mysqlclient](https://pypi.org/project/mysqlclient/)"),"."),Object(r.b)("p",null,"Here's the connection string:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"mysql://{username}:{password}@{host}/{database}\n")),Object(r.b)("p",null,"Host:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"For Localhost or Docker running Linux: ",Object(r.b)("inlineCode",{parentName:"li"},"localhost")," or ",Object(r.b)("inlineCode",{parentName:"li"},"127.0.0.1")),Object(r.b)("li",{parentName:"ul"},"For On Prem: IP address or Host name"),Object(r.b)("li",{parentName:"ul"},"For Docker running in OSX: ",Object(r.b)("inlineCode",{parentName:"li"},"docker.for.mac.host.internal"),"\nPort: ",Object(r.b)("inlineCode",{parentName:"li"},"3306")," by default")),Object(r.b)("p",null,"One problem with ",Object(r.b)("inlineCode",{parentName:"p"},"mysqlclient")," is that it will fail to connect to newer MySQL databases using ",Object(r.b)("inlineCode",{parentName:"p"},"caching_sha2_password")," for authentication, since the plugin is not included in the client. In this case, you should use ",Object(r.b)("inlineCode",{parentName:"p"},"[mysql-connector-python](https://pypi.org/project/mysql-connector-python/)")," instead:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"mysql+mysqlconnector://{username}:{password}@{host}/{database}\n")))}void 0!==b&&b&&b===Object(b)&&Object.isExtensible(b)&&!b.hasOwnProperty("__filemeta")&&Object.defineProperty(b,"__filemeta",{configurable:!0,value:{name:"MDXContent",filename:"src/pages/docs/Connecting to Databases/mysql.mdx"}}),b.isMDXComponent=!0}}]);
//# sourceMappingURL=component---src-pages-docs-connecting-to-databases-mysql-mdx-60ecece06bf9c2821267.js.map