1"use strict";(self.webpackChunkcivo_documentation=self.webpackChunkcivo_documentation||[]).push([[6509],{1549:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/navigate-database-section-f18024dd21a2d00dc16b03ffd85a3d05.png"},2910:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>o,toc:()=>r});const o=JSON.parse('{"id":"database/mysql/connect","title":"Connecting to your Civo MySQL Database","description":"Learn how to connect to your Civo MySQL database using the Civo dashboard or CLI tool. Retrieve the connection details and use the mysql client command.","source":"@site/content/docs/database/mysql/connect.md","sourceDirName":"database/mysql","slug":"/database/mysql/connect","permalink":"/docs/database/mysql/connect","draft":false,"unlisted":false,"editUrl":"https://git.civo.com/civo/database/public-docs/-/edit/main/content/docs/database/mysql/connect.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"Connecting to your Civo MySQL Database","description":"Learn how to connect to your Civo MySQL database using the Civo dashboard or CLI tool. Retrieve the connection details and use the mysql client command."},"sidebar":"mainSidebar","previous":{"title":"MySQL","permalink":"/docs/database/mysql"},"next":{"title":"Create a MySQL server on a Civo Compute Instance","permalink":"/docs/database/mysql/create-mysql-instance"}}');var a=t(4848),s=t(8453);const i={title:"Connecting to your Civo MySQL Database",description:"Learn how to connect to your Civo MySQL database using the Civo dashboard or CLI tool. Retrieve the connection details and use the mysql client command."},c=void 0,d={},r=[{value:"Retrieving your Connection Details",id:"retrieving-your-connection-details",level:2},{value:"Through the Civo Dashboard",id:"through-the-civo-dashboard",level:3},{value:"Through the Civo CLI",id:"through-the-civo-cli",level:3},{value:"Connect to your Civo Database",id:"connect-to-your-civo-database",level:2},{value:"Connection Troubleshooting",id:"connection-troubleshooting",level:2},{value:"Post-Connection Validation",id:"post-connection-validation",level:2},{value:"Use Case Examples",id:"use-case-examples",level:2}];function l(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components},{Head:o}=n;return o||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Head",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{children:(0,a.jsx)("title",{children:"Connecting to a Civo MySQL Database | Civo Documentation"})}),"\n",(0,a.jsxs)(n.p,{children:["After setting up your MySQL database with Civo, you can connect to it using various methods. This document guides you through obtaining connection details from the Civo dashboard and CLI, and connecting using the ",(0,a.jsx)(n.code,{children:"mysql"})," client command."]}),"\n",(0,a.jsx)(n.h2,{id:"retrieving-your-connection-details",children:"Retrieving your Connection Details"}),"\n",(0,a.jsx)(n.h3,{id:"through-the-civo-dashboard",children:"Through the Civo Dashboard"}),"\n",(0,a.jsx)(n.p,{children:"To retrieve your database connection details, go to:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Your ",(0,a.jsx)(n.a,{href:"https://dashboard.civo.com",children:"Civo Dashboard page"})]}),"\n",(0,a.jsx)(n.li,{children:"Navigate to the database section in the left-hand panel:"}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{alt:"Navigate to the Civo Database section",src:t(1549).A+"",width:"1600",height:"575"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Select your database to view the connection details, including:","\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Host IP/FQDN,"}),"\n",(0,a.jsx)(n.li,{children:"Username,"}),"\n",(0,a.jsx)(n.li,{children:"Password."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{alt:"Select your database to view the connection details",src:t(8099).A+"",width:"1441",height:"738"})}),"\n",(0,a.jsx)(n.h3,{id:"through-the-civo-cli",children:"Through the Civo CLI"}),"\n",(0,a.jsx)(n.p,{children:"Use the Civo CLI to manage your databases. Civo CLI allows you to create, update, delete, and list Civo Databases."}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"To list your databases, run:"}),"\n"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"civo database list\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{alt:"civo database list",src:t(5494).A+"",width:"1306",height:"181"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"To get the credentials of a specific database, use:"}),"\n"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"civo database credential [Database_Name] \n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{alt:"civo database credential",src:t(8537).A+"",width:"696",height:"182"})}),"\n",(0,a.jsx)(n.h2,{id:"connect-to-your-civo-database",children:"Connect to your Civo Database"}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.code,{children:"mysql"})," client command is a popular choice for connecting to MySQL databases."]}),"\n",(0,a.jsx)(n.p,{children:"Execute the command without the password and enter it when prompted to ensure security:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"mysql -h [MySQL host IP/FQDN] -u [username] -p\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{alt:"MySQL host IPFQDN",src:t(6265).A+"",width:"1447",height:"611"})}),"\n",(0,a.jsx)(n.h2,{id:"connection-troubleshooting",children:"Connection Troubleshooting"}),"\n",(0,a.jsx)(n.p,{children:"If you encounter connection issues, verify that your credentials are correct and that the Civo firewall allows connections from your source IP address, if you need further assistance contact support."}),"\n",(0,a.jsx)(n.h2,{id:"post-connection-validation",children:"Post-Connection Validation"}),"\n",(0,a.jsx)(n.p,{children:"Once connected, run a test query to validate the connection:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"SHOW DATABASES;\n"})}),"\n",(0,a.jsx)(n.p,{children:"Ensure that the expected databases are listed and accessible."}),"\n",(0,a.jsx)(n.h2,{id:"use-case-examples",children:"Use Case Examples"}),"\n",(0,a.jsxs)(n.p,{children:["For a comprehensive understanding of MySQL applications and use case examples, visit our ",(0,a.jsx)(n.a,{href:"https://www.civo.com/learn/categories/mysql",children:"MySQL tutorials"}),". These tutorials offer practical insights and showcase real-world scenarios, helping you effectively implement and utilize MySQL in diverse environments."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},5494:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/civo-database-list-ff4166f6bdf4b363bc9ede6cd03902cb.png"},6265:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/mysql-host-8087237bd4aff86d9e6374bbfec4ac3d.png"},8099:(e,n,t)=>{t.d(n,{A:()=>o});
1const o=t.p+"assets/images/view-connection-details-3f9b972636f2adde08a879d1afc27a29.png"},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>c});var o=t(6540);const a={},s=o.createContext(a);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),o.createElement(s.Provider,{value:n},e.children)}},8537:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/civo-database-credential-1189d270e4cad73581f61b84db8c42c0.png"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.