{"id":528,"date":"2013-01-29T16:11:30","date_gmt":"2013-01-29T16:11:30","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/01\/29\/is-mysql-available\/"},"modified":"2021-08-16T23:23:32","modified_gmt":"2021-08-17T03:23:32","slug":"is-mysql-available","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/","title":{"rendered":"Troubleshooting a Database connection error"},"content":{"rendered":"<p>Getting a database connection error, <a href=\"\/support\/website\/database-connection-error-2-could-not-connect-to-mysql\/\">such as this one in Joomla<\/a>, can be a scary thing to see on your website. It means that a program running on your site is not able to communicate with the MySQL database service to retrieve data. There are two main reasons for getting this error, either the program itself is not connecting properly due to login credentials mismatch from the program&#8217;s configuration files, or the MySQL service is currently not running on the server. Below are instructions on how to check both.<\/p>\n<h2>Checking Program Configuration Files<\/h2>\n<p>If you have recently installed your program or changed the configuration options in the program, you will want to check to ensure the configuration files match what the database is expecting. The credentials you will need to know are the <em>database name<\/em>, <em>host<\/em>, <em>database user name<\/em>, and the <em>database password<\/em>.<\/p>\n<p>First you will want to find these credentials in your program&#8217;s configuration files. If you are unsure where these files are located for your program, you can check to see if the program is listed in our <a href=\"\/support\/website\/find-config-files\/\">configuration files list<\/a> article. Be sure to write down all the database credentials you find as you will need to check them against the server.<\/p>\n<p>Once you have the credentials from the connecting program, you will need to check them against the server to make sure they are the same. The steps below will guide you on doing that.<\/p>\n<div>\n<ol class=\"article_list\">\n<li><a href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Log into your cPanel<\/a><\/li>\n<li>Locate the <em>Databases<\/em> category and click on the <strong>MySQL Databases<\/strong> icon.<\/li>\n<li>From the databases page you will see your databases in a list along with the database user in the column next to it.<\/li>\n<li>After confirming the database name and username, you will want to confirm the password. Since you cannot see the password, you will need to reset it by deleting the user and then <a href=\"\/support\/edu\/cpanel\/create-database-user\/\">recreating and attaching it to the database<\/a> using the password from the configuration file.<\/li>\n<\/ol><\/div>\n<h2>Telnet Test<\/h2>\n<p>If you have confirmed the credentials and are still getting the error, or the program was working and the database connection error suddenly began, it is possible the MySQL service is not running on the server at the moment. You can test this by running a test with something called Telnet. Telnet is a network protocol that you can use to connect to the server directly and check the service availability. Below are the steps to running a test with Telnet.<\/p>\n<div class=\"alert\">Note that newer versions of Windows do not have the Telnet service enabled by default. You may have to enable it before running this test. You can find instructions on how to do this in our article on <a href=\"\/support\/website\/enable-telnet\/\">enabling telnet on a Windows computer<\/a>.<\/div>\n<ol class=\"article_list\">\n<li>Log into your command line interface. With a Windows machine you go to <strong>Start -&gt; Run -&gt; cmd<\/strong>. With Mac, you will need to open your <strong>Terminal<\/strong> application.<\/li>\n<li>Once in the command line interface, you will type the command <strong><em>telnet example.com 3306<\/em><\/strong>. (be sure to replace example.com with your own domain name). Here is the breakdown of the command: <em>telnet<\/em> is the command to tell the computer to use the telnet protocol. The domain name is telling which domain name\/server to connect to, and the <em>3306<\/em> is the port for the MySQL service it will test. Below is an example of how your command should appear.\n<div class=\"cli\">telnet example.com 3306<\/div>\n<\/li>\n<li>Hit the enter key to activate the command. It will connect to the server using Telnet and test the port. If it is running, you will get a confirmation string beginning with the MySQL database version number.\n<div class=\"cli\">5.1.66-c115btB+Q&#8230;<\/div>\n<p>If the MySQL service is not running, you will receive an error as below:  <\/p>\n<div class=\"cli\">Connecting to example.com&#8230;Could not open connection to the host, on port 3306: Connect failed.<\/div>\n<\/li>\n<\/ol>\n<p>If you receive the connection failed error, the likely causes of service unavailability are either a temporary high load on the server, or the service is being restarted by the Systems Administration team. This should clear up within a few minutes. If you receive the connection confirmation and are still receiving the error, you will want to <a href=\"\/support\/amp\/how-to-get-great-technical-support\/\">contact our Live Support team<\/a> for further assistance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting a database connection error, such as this one in Joomla, can be a scary thing to see on your website. It means that a program running on your site is not able to communicate with the MySQL database service to retrieve data. There are two main reasons for getting this error, either the program<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/\"> Read More ><\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4288,4335,4305],"tags":[],"class_list":["post-528","post","type-post","status-publish","format-standard","hentry","category-website","category-error-numbers","category-databases"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Troubleshooting a Database connection error | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Want to see if the MySQL service is running on your server? Learn how in this tutorial.\" \/>\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.inmotionhosting.com\/support\/website\/is-mysql-available\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Troubleshooting a Database connection error | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Want to see if the MySQL service is running on your server? Learn how in this tutorial.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-29T16:11:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:23:32+00:00\" \/>\n<meta name=\"author\" content=\"Scott Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Scott Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/\"},\"author\":{\"name\":\"Scott Mitchell\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\"},\"headline\":\"Troubleshooting a Database connection error\",\"datePublished\":\"2013-01-29T16:11:30+00:00\",\"dateModified\":\"2021-08-17T03:23:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/\"},\"wordCount\":703,\"commentCount\":19,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Website\",\"Website Error Numbers\",\"Working with Databases\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/\",\"name\":\"Troubleshooting a Database connection error | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-01-29T16:11:30+00:00\",\"dateModified\":\"2021-08-17T03:23:32+00:00\",\"description\":\"Want to see if the MySQL service is running on your server? Learn how in this tutorial.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Troubleshooting a Database connection error\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\",\"name\":\"Scott Mitchell\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Troubleshooting a Database connection error | InMotion Hosting","description":"Want to see if the MySQL service is running on your server? Learn how in this tutorial.","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.inmotionhosting.com\/support\/website\/is-mysql-available\/","og_locale":"en_US","og_type":"article","og_title":"Troubleshooting a Database connection error | InMotion Hosting","og_description":"Want to see if the MySQL service is running on your server? Learn how in this tutorial.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-01-29T16:11:30+00:00","article_modified_time":"2021-08-17T03:23:32+00:00","author":"Scott Mitchell","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Scott Mitchell","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/"},"author":{"name":"Scott Mitchell","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed"},"headline":"Troubleshooting a Database connection error","datePublished":"2013-01-29T16:11:30+00:00","dateModified":"2021-08-17T03:23:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/"},"wordCount":703,"commentCount":19,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Website","Website Error Numbers","Working with Databases"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/","name":"Troubleshooting a Database connection error | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-01-29T16:11:30+00:00","dateModified":"2021-08-17T03:23:32+00:00","description":"Want to see if the MySQL service is running on your server? Learn how in this tutorial.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/is-mysql-available\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Troubleshooting a Database connection error"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed","name":"Scott Mitchell","url":"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=528"}],"version-history":[{"count":2,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/528\/revisions"}],"predecessor-version":[{"id":85011,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/528\/revisions\/85011"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}