{"id":2198,"date":"2015-05-20T10:32:15","date_gmt":"2015-05-20T10:32:15","guid":{"rendered":"http:\/\/kedar.nitty-witty.com\/?p=2198"},"modified":"2023-04-30T17:27:55","modified_gmt":"2023-04-30T17:27:55","slug":"cannot-connect-to-mysql-server-on-localhost-cacti-error","status":"publish","type":"post","link":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error","title":{"rendered":"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I was installing and setting up Cacti recently and faced following error:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><i>&#8220;FATAL: Cannot connect to MySQL server on &#8216;localhost&#8217;.&#8221;<\/i><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This post includes debugging steps and solution for the issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Along with the Cacti&#8217;s web-interface, the poller.php was generating the same error as follows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@ubuntu:\/var\/www\/cacti# php \/var\/www\/cacti\/poller.php\nFATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include\/config.php'\n<\/pre>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">Also the apache error log expressed following errors:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tail -10f \/var\/log\/apache2\/error.log\n[Mon May 04 02:17:56 2015] [error] [client 127.0.0.1] PHP Warning:  include_once(\/var\/www\/cacti-0.8.8c\/lib\/adodb\/adodb.inc.php): failed to open stream: Permission denied in \/var\/www\/cacti-0.8.8c\/include\/global.php on line 205\n[Mon May 04 02:17:56 2015] [error] [client 127.0.0.1] PHP Warning:  include_once(): Failed opening '\/var\/www\/cacti-0.8.8c\/lib\/adodb\/adodb.inc.php' for inclusion (include_path='.:\/usr\/share\/php:\/usr\/share\/pear') in \/var\/www\/cacti-0.8.8c\/include\/global.php on line 205\n[Mon May 04 02:17:56 2015] [error] [client 127.0.0.1] PHP Warning:  include_once(\/var\/www\/cacti-0.8.8c\/lib\/database.php): failed to open stream: Permission denied in \/var\/www\/cacti-0.8.8c\/include\/global.php on line 206\n[Mon May 04 02:17:56 2015] [error] [client 127.0.0.1] PHP Warning:  include_once(): Failed opening '\/var\/www\/cacti-0.8.8c\/lib\/database.php' for inclusion (include_path='.:\/usr\/share\/php:\/usr\/share\/pear') in \/var\/www\/cacti-0.8.8c\/include\/global.php on line 206\n[Mon May 04 02:17:56 2015] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function db_connect_real() in \/var\/www\/cacti-0.8.8c\/include\/global.php on line 209\n[Mon May 04 02:18:42 2015] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: host in \/var\/www\/cacti-0.8.8c\/lib\/database.php on line 35\n[Mon May 04 02:18:42 2015] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: user in \/var\/www\/cacti-0.8.8c\/lib\/database.php on line 35\n[Mon May 04 02:18:42 2015] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: pass in \/var\/www\/cacti-0.8.8c\/lib\/database.php on line 35\n[Mon May 04 02:18:42 2015] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: db_name in \/var\/www\/cacti-0.8.8c\/lib\/database.php on line 35\n[Mon May 04 02:18:42 2015] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: db_type in \/var\/www\/cacti-0.8.8c\/lib\/database.php on line 35\n[Mon May 04 02:18:42 2015] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: port in \/var\/www\/cacti-0.8.8c\/lib\/database.php on line 35\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting steps:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verified we have correct dir permisssions (Gave permissions: ugo+rx).<\/li>\n\n\n\n<li>Verified ping to localhost (works). If you&#8217;re having other hostname check to see if it&#8217;s ping&#8217;able.<\/li>\n\n\n\n<li>Confirmed that connectivity to mysql-server using mysql client using same parameters works.<\/li>\n\n\n\n<li>There is no bind-address specified in MySQL config that may cause connectivity issues.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After checking on above possibilities, the issue was still there. As said the Cacti&#8217;s web-interface on web-browser http:\/\/localhost\/cacti generated following errors:<br><em> FATAL: Cannot connect to MySQL server on &#8216;localhost&#8217;. Please make sure you have specified a valid MySQL database name in &#8216;include\/config.php&#8217;<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I checked the global.php configurations and found db_connect_read function:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># File: include\/global.php\n\n\/* connect to the database server *\/\ndb_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port, $database_ssl);\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The configuration in Cacti&#8217;s database config file is as follows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@ubuntu:\/var\/www\/cacti# cat include\/config.php \n$database_type = \"mysql\";\n$database_default = \"cacti\";\n$database_hostname = \"localhost\";\n$database_username = \"cacti\";\n$database_password = \"xxxxx\";\n$database_port = \"3306\";\n$database_ssl = false;\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Changing $database_hostname to 127.0.0.1 in include\/config.php made the Cacti setup work!!<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$database_hostname = \"127.0.0.1\";\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Though I decided to resolve this keeping database_hostname to &#8220;localhost&#8221;. I looked at possible issues related to db_connect_real and php.ini details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Added doing following change in php configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># vi \/etc\/php5\/apache2\/php.ini\nmysql.default_socket =\/var\/lib\/mysql\/mysqld.sock\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart apache and boom&#8230; Connectivity worked with hostname as &#8220;localhost&#8221;, the Cacti admin page loaded!!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But why did that socket file change worked for hostname &#8220;localhost&#8221;!!! and why it was not concerned if I use hostname as IP (127.0.0.1)!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I debugged further and created a softlink to MySQL socket-file at \/var\/run\/mysqld\/mysqld.sock and removed &#8220;mysql.default_socket =\/var\/lib\/mysql\/mysqld.sock &#8221; from php.ini<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ln -s \/var\/lib\/mysql\/mysqld.sock \/var\/run\/mysqld\/mysqld.sock\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">cat php.ini | grep default_socket\n## mysql.default_socket=\/var\/lib\/mysql\/mysqld.sock\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restarted apache<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/etc\/init.d\/apache2 restart\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and the Cacti worked for &#8220;localhost&#8221; database host!!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, for localhost as database_hostname, db_connect_real expect \/var\/run\/mysqld\/mysqld.sock as socket! I wonder if db_connect_real would like to buy a $database_socket variable in Cacti&#8217;s config.php?!!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anyways, there could be other issues that we checked earlier while &#8220;Troubleshooting Steps&#8221;, the issue here was MySQL&#8217;s socket file.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you&#8217;re using location other than \/var\/run\/mysqld\/mysqld.sock for mysql socket, specify it in &#8220;mysql.default_socket&#8221; in php.ini<\/li>\n\n\n\n<li>If you can restart MySQL, change it to use socket=\/var\/run\/mysqld\/mysqld.sock.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Do comment if you have more information on this behaviour!<\/p>\n","protected":false},"excerpt":{"rendered":"FATAL: Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error &#8211; Solution to the issue while setting-up.\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8,6],"tags":[570,571,427,75],"class_list":["post-2198","post","type-post","status-publish","format-standard","category-mysql","category-technical","tag-cacti-error","tag-cannot-connect-to-mysql-on-localhost","tag-mysql","tag-mysql-server"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Cannot connect to MySQL server on &#039;localhost&#039;: Cacti Error - Troubleshooting and solution.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kedar\"\/>\n\t<meta name=\"google-site-verification\" content=\"_Bu1h5r0PxIC0D2jBVdmYN45RTeG9ogcX85XLkbG1qA\" \/>\n\t<meta name=\"msvalidate.01\" content=\"116B62074CBCA1BA99B8CCE09CCF2FB8\" \/>\n\t<meta name=\"keywords\" content=\"cacti,mysql,fatal-cannot-connect,localhost,cacti-setup,cacti-installation,cacti error,cannot connect to mysql on localhost,mysql server\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Change Is Inevitable | Kedar Vaijanapurkar&#039;s Blog for MySQL, technology and various subjects\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Cannot connect to MySQL server on &#039;localhost&#039;: Cacti Error | Change Is Inevitable\" \/>\n\t\t<meta property=\"og:description\" content=\"Cannot connect to MySQL server on &#039;localhost&#039;: Cacti Error - Troubleshooting and solution.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2015-05-20T10:32:15+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-04-30T17:27:55+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Cannot connect to MySQL server on &#039;localhost&#039;: Cacti Error | Change Is Inevitable\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Cannot connect to MySQL server on &#039;localhost&#039;: Cacti Error - Troubleshooting and solution.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#article\",\"name\":\"Cannot connect to MySQL server on 'localhost': Cacti Error | Change Is Inevitable\",\"headline\":\"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error\",\"author\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"},\"datePublished\":\"2015-05-20T10:32:15+00:00\",\"dateModified\":\"2023-04-30T17:27:55+00:00\",\"inLanguage\":\"en-US\",\"commentCount\":4,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#webpage\"},\"articleSection\":\"MySQL, Technical, cacti error, cannot connect to mysql on localhost, MySQL, mysql server\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/technical#listItem\",\"name\":\"Technical\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/technical#listItem\",\"position\":2,\"name\":\"Technical\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/technical\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#listItem\",\"name\":\"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#listItem\",\"position\":3,\"name\":\"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/technical#listItem\",\"name\":\"Technical\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\",\"name\":\"Kedar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin\",\"name\":\"Kedar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#webpage\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error\",\"name\":\"Cannot connect to MySQL server on 'localhost': Cacti Error | Change Is Inevitable\",\"description\":\"Cannot connect to MySQL server on 'localhost': Cacti Error - Troubleshooting and solution.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/cannot-connect-to-mysql-server-on-localhost-cacti-error#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"datePublished\":\"2015-05-20T10:32:15+00:00\",\"dateModified\":\"2023-04-30T17:27:55+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/\",\"name\":\"..::CHANGE is INEVITABLE::..\",\"description\":\"Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Cannot connect to MySQL server on 'localhost': Cacti Error | Change Is Inevitable","description":"Cannot connect to MySQL server on 'localhost': Cacti Error - Troubleshooting and solution.","canonical_url":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error","robots":"max-image-preview:large","keywords":"cacti,mysql,fatal-cannot-connect,localhost,cacti-setup,cacti-installation,cacti error,cannot connect to mysql on localhost,mysql server","webmasterTools":{"google-site-verification":"_Bu1h5r0PxIC0D2jBVdmYN45RTeG9ogcX85XLkbG1qA","msvalidate.01":"116B62074CBCA1BA99B8CCE09CCF2FB8","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#article","name":"Cannot connect to MySQL server on 'localhost': Cacti Error | Change Is Inevitable","headline":"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error","author":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"publisher":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"},"datePublished":"2015-05-20T10:32:15+00:00","dateModified":"2023-04-30T17:27:55+00:00","inLanguage":"en-US","commentCount":4,"mainEntityOfPage":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#webpage"},"isPartOf":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#webpage"},"articleSection":"MySQL, Technical, cacti error, cannot connect to mysql on localhost, MySQL, mysql server"},{"@type":"BreadcrumbList","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/kedar.nitty-witty.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/technical#listItem","name":"Technical"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/technical#listItem","position":2,"name":"Technical","item":"https:\/\/kedar.nitty-witty.com\/blog\/category\/technical","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#listItem","name":"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error"},"previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#listItem","position":3,"name":"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error","previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/technical#listItem","name":"Technical"}}]},{"@type":"Person","@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person","name":"Kedar","image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"}},{"@type":"Person","@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author","url":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin","name":"Kedar","image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"}},{"@type":"WebPage","@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#webpage","url":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error","name":"Cannot connect to MySQL server on 'localhost': Cacti Error | Change Is Inevitable","description":"Cannot connect to MySQL server on 'localhost': Cacti Error - Troubleshooting and solution.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error#breadcrumblist"},"author":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"creator":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"datePublished":"2015-05-20T10:32:15+00:00","dateModified":"2023-04-30T17:27:55+00:00"},{"@type":"WebSite","@id":"https:\/\/kedar.nitty-witty.com\/blog\/#website","url":"https:\/\/kedar.nitty-witty.com\/blog\/","name":"..::CHANGE is INEVITABLE::..","description":"Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects","inLanguage":"en-US","publisher":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person"}}]},"og:locale":"en_US","og:site_name":"Change Is Inevitable | Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects","og:type":"article","og:title":"Cannot connect to MySQL server on 'localhost': Cacti Error | Change Is Inevitable","og:description":"Cannot connect to MySQL server on 'localhost': Cacti Error - Troubleshooting and solution.","og:url":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error","article:published_time":"2015-05-20T10:32:15+00:00","article:modified_time":"2023-04-30T17:27:55+00:00","twitter:card":"summary","twitter:title":"Cannot connect to MySQL server on 'localhost': Cacti Error | Change Is Inevitable","twitter:description":"Cannot connect to MySQL server on 'localhost': Cacti Error - Troubleshooting and solution."},"aioseo_meta_data":{"post_id":"2198","title":"Cannot connect to MySQL server on 'localhost': Cacti Error | #site_title","description":"Cannot connect to MySQL server on 'localhost': Cacti Error - Troubleshooting and solution.","keywords":[{"label":"Cacti","value":"Cacti"},{"label":"mysql","value":"mysql"},{"label":"Fatal-cannot-connect","value":"Fatal-cannot-connect"},{"label":"localhost","value":"localhost"},{"label":"Cacti-setup","value":"Cacti-setup"},{"label":"Cacti-installation","value":"Cacti-installation"}],"keyphrases":{"focus":{"keyphrase":"mysql server","score":88,"analysis":{"keyphraseInTitle":{"score":9,"maxScore":9,"error":0},"keyphraseInDescription":{"score":9,"maxScore":9,"error":0},"keyphraseLength":{"score":9,"maxScore":9,"error":0,"length":2},"keyphraseInURL":{"score":5,"maxScore":5,"error":0},"keyphraseInIntroduction":{"score":3,"maxScore":9,"error":1},"keyphraseInSubHeadings":{"score":9,"maxScore":9,"error":0},"keyphraseInImageAlt":[]}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-24 17:40:44","updated":"2025-08-16 19:14:53","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\/category\/technical\" title=\"Technical\">Technical<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCannot connect to MySQL server on \u2018localhost\u2019: Cacti Error\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/kedar.nitty-witty.com\/blog"},{"label":"Technical","link":"https:\/\/kedar.nitty-witty.com\/blog\/category\/technical"},{"label":"Cannot connect to MySQL server on &#8216;localhost&#8217;: Cacti Error","link":"https:\/\/kedar.nitty-witty.com\/blog\/cannot-connect-to-mysql-server-on-localhost-cacti-error"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/2198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/comments?post=2198"}],"version-history":[{"count":7,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/2198\/revisions"}],"predecessor-version":[{"id":2863,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/2198\/revisions\/2863"}],"wp:attachment":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/media?parent=2198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/categories?post=2198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/tags?post=2198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}