{"id":38211,"date":"2021-08-18T12:30:00","date_gmt":"2021-08-18T17:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=38211"},"modified":"2022-06-03T03:31:34","modified_gmt":"2022-06-03T08:31:34","slug":"access-your-database-remotely-through-an-ssh-tunnel","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/","title":{"rendered":"Access Your Database Remotely Through an SSH Tunnel"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"742\" height=\"372\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg\" alt=\"access your database remotely through an ssh tunnel\" class=\"wp-image-38229\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel-150x75.jpg 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/figure>\n\n\n\n<p>Secure Shell or SSH is a client-server-based communication protocol that is used to connect securely from one machine to another. It uses a network port to create a connection session between the server that listens on the chosen port and the client which sends the SSH connection request on that port.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-gain-access-your-database-remotely-througn-an-ssh-tunnel.png\" alt=\"\" class=\"wp-image-38244\" width=\"128\" height=\"128\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-gain-access-your-database-remotely-througn-an-ssh-tunnel.png 225w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-gain-access-your-database-remotely-througn-an-ssh-tunnel-150x150.png 150w\" sizes=\"(max-width: 128px) 100vw, 128px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>With this protocol, we can manage our servers and work on them remotely. For example, we can add\/edit\/delete the services running on the server using an SSH client like PuTTY or Terminal.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>SSH tunneling is also known as SSH port forwarding, which means we can route our traffic through SSH secure connection. It allows us to use the established SSH connection to set up a new &#8220;secure&#8221; connection from your computer to the remote server. There are three types of SSH port forwarding.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Local Port Forwarding<\/li><li>Remote Port Forwarding<\/li><li>Dynamic Port Forwarding<\/li><\/ul>\n\n\n\n<p>By default, MySQL or PostgreSQL server only listens on localhost which means it can only be accessed by other applications hosted on the same server. To connect remotely to the server, we need to make MySQL or PostgreSQL listen not only on localhost, we would also need to add or edit the database user&#8217;s permission to be able to connect remotely, modify the firewall, etc. For some people, this would take time and they would use SSH tunneling instead.<\/p>\n\n\n\n<p>In this tutorial, we will show you how to connect to a MySQL server through SSH tunneling, or local port forwarding.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-prerequisites\">Prerequisites:<\/h3>\n\n\n\n<p>SSH Client<br>SSH login credentials<br>MySQL client<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-create-ssh-tunnel-and-connect-to-the-database-server-from-windows\">Create SSH Tunnel and Connect to the Database Server from Windows<\/h2>\n\n\n\n<p>To connect to your server where the MySQL server is hosted, you will need an SSH client. If you use Windows as your computer&#8217;s operating system, you can use a free software called PuTTY to connect to your server. You can download PuTTY from <code>https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html<\/code><\/p>\n\n\n\n<p>Once downloaded, run the application and enter the following information:<\/p>\n\n\n\n<p>Host Name (or IP address) \u2013 enter your server hostname or its IP address.<br>Port \u2013 enter the listening port of your server\u2019s SSH daemon<br>Connection type \u2013 SSH<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"452\" height=\"441\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-access-your-database-remotely-through-an-ssh-tunnel.png\" alt=\"how to access your database remotely through an ssh tunnel\" class=\"wp-image-38231\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-access-your-database-remotely-through-an-ssh-tunnel.png 452w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-access-your-database-remotely-through-an-ssh-tunnel-300x293.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-access-your-database-remotely-through-an-ssh-tunnel-150x146.png 150w\" sizes=\"(max-width: 452px) 100vw, 452px\" \/><\/figure>\n\n\n\n<p>On the left side navigation tree in PuTTY, click on Connection &gt; SSH &gt; Tunnels. Enter the database server (MySQL, PostgreSQL, etc) port under the &#8220;Source port&#8221;. Then in the destination box type &#8220;127.0.0.1:3306&#8221; and finally click on Add. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"453\" height=\"446\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/access-database-remotely-through-an-ssh-tunnel.png\" alt=\"access database remotely through an ssh tunnel\" class=\"wp-image-38232\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/access-database-remotely-through-an-ssh-tunnel.png 453w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/access-database-remotely-through-an-ssh-tunnel-300x295.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/access-database-remotely-through-an-ssh-tunnel-150x148.png 150w\" sizes=\"(max-width: 453px) 100vw, 453px\" \/><\/figure>\n\n\n\n<p>Now, click on the Session in the Category navigation tree, type &#8220;tunnel&#8221; in the &#8220;Saved Session&#8221; box then click on Save button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"451\" height=\"442\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-gain-access-to-your-database-remotely-through-an-ssh-tunnel.png\" alt=\"how to gain access to your database remotely through an ssh tunnel\" class=\"wp-image-38233\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-gain-access-to-your-database-remotely-through-an-ssh-tunnel.png 451w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-gain-access-to-your-database-remotely-through-an-ssh-tunnel-300x294.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-gain-access-to-your-database-remotely-through-an-ssh-tunnel-150x147.png 150w\" sizes=\"(max-width: 451px) 100vw, 451px\" \/><\/figure>\n\n\n\n<p>In the future, you do not need to create a new session for tunneling, you can simply load the saved session. Now, we can click on the Load button and you will be asked for your SSH login credentials.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"660\" height=\"418\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/gain-access-to-database-remotely-through-an-ssh-tunnel.png\" alt=\"gain access to database remotely through an ssh tunnel\" class=\"wp-image-38234\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/gain-access-to-database-remotely-through-an-ssh-tunnel.png 660w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/gain-access-to-database-remotely-through-an-ssh-tunnel-300x190.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/gain-access-to-database-remotely-through-an-ssh-tunnel-150x95.png 150w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\"><\/h2>\n\n\n\n<p>In this tutorial, we are going to use MySQL shell to access the remote MySQL server through SSH tunneling. Once the SSH session is connected, you can open your Windows command prompt and go to your MySQL shell directory and run the following command as if you are accessing from the same server.<\/p>\n\n\n\n<pre id=\"block-a766d2c8-2890-4758-8872-e9fdc777ab84\" class=\"wp-block-preformatted\">mysqlsh -u sshtunnel -p -h localhost<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"978\" height=\"512\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/get-access-to-database-remotely-through-an-ssh-tunnel.png\" alt=\"get access to database remotely through an ssh tunnel\" class=\"wp-image-38235\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/get-access-to-database-remotely-through-an-ssh-tunnel.png 978w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/get-access-to-database-remotely-through-an-ssh-tunnel-300x157.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/get-access-to-database-remotely-through-an-ssh-tunnel-150x79.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/get-access-to-database-remotely-through-an-ssh-tunnel-768x402.png 768w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/figure>\n\n\n\n<p>As seen in the picture, we are using MySQL user &#8216;sshtunnel&#8217;, make sure you change this to your MySQL username. Once connected, you will see &#8220;<code>MySQL localhost:3306 ssl JS<\/code>&#8220;, to switch to MySQL mode just type <code>\\sql <\/code>and hit enter.<\/p>\n\n\n\n<p>Now, you are in MySQL mode and you should be able to run MySQL shell commands.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-create-ssh-tunnel-and-connect-to-the-database-server-from-linux-and-macos\">Create SSH Tunnel and Connect to the Database Server from Linux and MacOS<\/h2>\n\n\n\n<p><br>If you are using a Linux distro or MacOS, you do not need to download an SSH client because it&#8217;s already available on your system.<\/p>\n\n\n\n<p>To connect to your MySQL server through SSH, you can use Terminal. Run Terminal and connect to your server by invoking this command:<\/p>\n\n\n\n<pre id=\"block-3df061af-62b8-407b-a99b-94619a2d9cf8\" class=\"wp-block-preformatted\">ssh -fNg -L 3306:127.0.0.1:3306 sshtunnel@123.123.123.123 -p7022<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"912\" height=\"211\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-get-access-to-database-remotely-through-an-ssh-tunnel.png\" alt=\"how to get access to database remotely through an ssh tunnel\" class=\"wp-image-38236\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-get-access-to-database-remotely-through-an-ssh-tunnel.png 912w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-get-access-to-database-remotely-through-an-ssh-tunnel-300x69.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-get-access-to-database-remotely-through-an-ssh-tunnel-150x35.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/how-to-get-access-to-database-remotely-through-an-ssh-tunnel-768x178.png 768w\" sizes=\"(max-width: 912px) 100vw, 912px\" \/><\/figure>\n\n\n\n<p>With this command, we are going to log in to 123.123.123.123 (replace this with your server&#8217;s actual IP address) with sshtunnel as the SSH username through port 7022 (replace this with your SSH listening port), you will be asked for &#8220;sshtunnel&#8221; password then once entered the command will go into the background (-f) and not execute remote commands (-N), and set up port-forwarding (-L local_port:localhost:remote_port). In this example, we will use 3306 both as a local port and a remote port. If you already have a MySQL server running on your machine, you can use another port.<\/p>\n\n\n\n<p>Once connected, you should be able to connect to a remote database locally, just like accessing a local database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-from-linux-machine\">From Linux machine<\/h3>\n\n\n\n<pre id=\"block-580ec439-a590-48db-ab1c-a2fe8ea8536e\" class=\"wp-block-preformatted\">mysql -h 127.0.0.1 -P 3306 -u dbuser -p db<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-from-macos\">From MacOS<\/h3>\n\n\n\n<pre id=\"block-63284d9f-f9ae-4fcd-9358-73b23e94ff1e\" class=\"wp-block-preformatted\">mysqlsh -h 127.0.0.1 -P 3306 -u dbuser -p <\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1012\" height=\"454\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/easily-access-database-remotely-through-an-ssl-tunnel.png\" alt=\"easily access database remotely through an ssl tunnel\" class=\"wp-image-38237\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/easily-access-database-remotely-through-an-ssl-tunnel.png 1012w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/easily-access-database-remotely-through-an-ssl-tunnel-300x135.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/easily-access-database-remotely-through-an-ssl-tunnel-150x67.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/07\/easily-access-database-remotely-through-an-ssl-tunnel-768x345.png 768w\" sizes=\"(max-width: 1012px) 100vw, 1012px\" \/><\/figure>\n\n\n\n<p>That&#8217;s all! You should be able to connect to your database server through an SSH tunnel. You can also use an application to access the remote MySQL server, like Navicat or MySQL Bench. To have this done within minutes, our team of professionals can help you, as long as you have <a href=\"https:\/\/www.rosehosting.com\/database-hosting.html\" target=\"_blank\" rel=\"noreferrer noopener\">managed database hosting<\/a> with RoseHosting. They are available for support and assistance 24\/7, all year long.<\/p>\n\n\n\n<p>If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Secure Shell or SSH is a client-server-based communication protocol that is used to connect securely from one machine to another. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Access Your Database Remotely Through an SSH Tunnel\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#more-38211\" aria-label=\"Read more about Access Your Database Remotely Through an SSH Tunnel\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":38229,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[1926,41,1927,1929],"class_list":["post-38211","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-access","tag-database","tag-remotely","tag-ssh-tunnel","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Access Your Database Remotely Through an SSH Tunnel | RoseHosting<\/title>\n<meta name=\"description\" content=\"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.\" \/>\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.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Access Your Database Remotely Through an SSH Tunnel | RoseHosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-18T17:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:31:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg?v=1626254230\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Access Your Database Remotely Through an SSH Tunnel | RoseHosting\" \/>\n<meta name=\"twitter:description\" content=\"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"Access Your Database Remotely Through an SSH Tunnel\",\"datePublished\":\"2021-08-18T17:30:00+00:00\",\"dateModified\":\"2022-06-03T08:31:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/\"},\"wordCount\":835,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/access-your-database-remotely-through-an-ssh-tunnel.jpg\",\"keywords\":[\"access\",\"database\",\"remotely\",\"ssh tunnel\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/\",\"name\":\"Access Your Database Remotely Through an SSH Tunnel | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/access-your-database-remotely-through-an-ssh-tunnel.jpg\",\"datePublished\":\"2021-08-18T17:30:00+00:00\",\"dateModified\":\"2022-06-03T08:31:34+00:00\",\"description\":\"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/access-your-database-remotely-through-an-ssh-tunnel.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/access-your-database-remotely-through-an-ssh-tunnel.jpg\",\"width\":742,\"height\":372,\"caption\":\"access your database remotely through an ssh tunnel\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/access-your-database-remotely-through-an-ssh-tunnel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Access Your Database Remotely Through an SSH Tunnel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Access Your Database Remotely Through an SSH Tunnel | RoseHosting","description":"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.","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.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/","og_locale":"en_US","og_type":"article","og_title":"Access Your Database Remotely Through an SSH Tunnel | RoseHosting","og_description":"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.","og_url":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2021-08-18T17:30:00+00:00","article_modified_time":"2022-06-03T08:31:34+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg?v=1626254230","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_title":"Access Your Database Remotely Through an SSH Tunnel | RoseHosting","twitter_description":"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"Access Your Database Remotely Through an SSH Tunnel","datePublished":"2021-08-18T17:30:00+00:00","dateModified":"2022-06-03T08:31:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/"},"wordCount":835,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg","keywords":["access","database","remotely","ssh tunnel"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/","url":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/","name":"Access Your Database Remotely Through an SSH Tunnel | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg","datePublished":"2021-08-18T17:30:00+00:00","dateModified":"2022-06-03T08:31:34+00:00","description":"Learn how to access your database remotely through an SSH tunnel with this extensive guide, suitable for beginners.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/access-your-database-remotely-through-an-ssh-tunnel.jpg","width":742,"height":372,"caption":"access your database remotely through an ssh tunnel"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/access-your-database-remotely-through-an-ssh-tunnel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Access Your Database Remotely Through an SSH Tunnel"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=38211"}],"version-history":[{"count":11,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38211\/revisions"}],"predecessor-version":[{"id":38245,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38211\/revisions\/38245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/38229"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=38211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=38211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=38211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}