{"id":13135,"date":"2024-05-23T10:11:12","date_gmt":"2024-05-23T10:11:12","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=13135"},"modified":"2026-02-26T14:02:11","modified_gmt":"2026-02-26T14:02:11","slug":"how-to-resolve-mysql-command-not-found","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/","title":{"rendered":"How to Resolve: MySQL Command Not Found"},"content":{"rendered":"<p>Encountering the \u2018MySQL command not found\u2019 error usually indicates that MySQL software is not installed on your system or its installation path is not included in the system\u2019s PATH environment variable.<\/p>\n<p>This guide outlines steps to resolve the issue-<\/p>\n<ol>\n<li>Understanding the Error-<br \/>\nWhen trying to execute MySQL from the command line and encountering the \u2018MySQL command not found\u2019 error, it means the system\u2019s helpless to locate the MySQL executable within directories listed in the PATH environment variable. This error commonly arises in new installations or when switching between multiple MySQL versions.<\/li>\n<li>Verifying MySQL Installation-\n<ol>\n<li>Begin by confirming whether MySQL installed. Execute the following command in your terminal-\n<pre>mysql \u2013version<\/pre>\n<\/li>\n<li>If MySQL is installed, this command returns its version. If not, MySQL needs to be installed.<\/li>\n<\/ol>\n<\/li>\n<li>Installing MySQL-\n<ol>\n<li>For Linux:\n<pre>sudo apt-get update\r\n\r\nsudo apt-get install mysql-server<\/pre>\n<\/li>\n<li>For macOS:\n<pre>brew install mysql<\/pre>\n<\/li>\n<li>For Windows:<br \/>\nDownload the installer from the MySQL website and follow the installation wizard.<\/li>\n<\/ol>\n<\/li>\n<li>Updating the PATH Environment Variable-<br \/>\nIf MySQL installed but unrecognized, append its directory to the PATH environment variable.<\/p>\n<ol>\n<li>For Linux and macOS:\n<ol>\n<li>Locate the MySQL installation path:\n<pre>which mysql<\/pre>\n<\/li>\n<li>Add the path to your profile script (like .bashrc or .zshrc):\n<pre>echo 'export PATH=\"\/path\/to\/mysql\/bin:$PATH\"' &gt;&gt; ~\/.bashrc\r\n\r\nsource ~\/.bashrc<\/pre>\n<\/li>\n<li>Replace &#8220;\/path\/to\/mysql\/bin&#8221; with the actual path.<\/li>\n<\/ol>\n<\/li>\n<li>For Windows-\n<ol>\n<li>Search for \u2018Environment Variables\u2019 in the Start menu.<\/li>\n<li>Edit the \u2018Path\u2019 variable under \u2018System variables.\u2019<\/li>\n<li>Add the path to the MySQL bin directory.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li>Verifying the Fix-<br \/>\nAfter installation or PATH update, re-run \u201cmysql \u2013version\u201d. If the setup is correct, the command should now display the MySQL version.<\/li>\n<li>Troubleshooting- If the issue persists-\n<ol>\n<li>Ensure correct permissions to access MySQL.<\/li>\n<li>Check for typos in the PATH variable.<\/li>\n<li>Restart your terminal or system to apply changes.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>That is it!<\/p>\n<p>You can more KB about <a href=\"https:\/\/www.bodhost.com\/kb\/how-to-inspect-the-sizes-of-mysql-databases-and-tables\/\" target=\"_blank\" rel=\"noopener\">How to Inspect the Sizes of MySQL Databases and Tables<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Encountering the \u2018MySQL command not found\u2019 error usually indicates that MySQL software is not installed on your system or its installation path is not included in the system\u2019s PATH environment&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[857],"tags":[1533],"class_list":["post-13135","post","type-post","status-publish","format-standard","hentry","category-sql","tag-mysql-command"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MySQL Command Not Found? Here\u2019s How to Solve It<\/title>\n<meta name=\"description\" content=\"This article explains how to Resolve- &quot;MySQL Command Not Found&quot; error. Follow the simple steps in this KB.\" \/>\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.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Command Not Found? Here\u2019s How to Solve It\" \/>\n<meta property=\"og:description\" content=\"This article explains how to Resolve- &quot;MySQL Command Not Found&quot; error. Follow the simple steps in this KB.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-23T10:11:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:02:11+00:00\" \/>\n<meta name=\"author\" content=\"Serena\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Serena\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/\"},\"author\":{\"name\":\"Serena\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/ffd3f118493c99471ae5bd4790a55830\"},\"headline\":\"How to Resolve: MySQL Command Not Found\",\"datePublished\":\"2024-05-23T10:11:12+00:00\",\"dateModified\":\"2026-02-26T14:02:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/\"},\"wordCount\":292,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"MySQL Command\"],\"articleSection\":[\"SQL\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/\",\"name\":\"MySQL Command Not Found? Here\u2019s How to Solve It\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2024-05-23T10:11:12+00:00\",\"dateModified\":\"2026-02-26T14:02:11+00:00\",\"description\":\"This article explains how to Resolve- \\\"MySQL Command Not Found\\\" error. Follow the simple steps in this KB.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-resolve-mysql-command-not-found\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SQL\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/sql\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Resolve: MySQL Command Not Found\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/ffd3f118493c99471ae5bd4790a55830\",\"name\":\"Serena\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"caption\":\"Serena\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/seema\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL Command Not Found? Here\u2019s How to Solve It","description":"This article explains how to Resolve- \"MySQL Command Not Found\" error. Follow the simple steps in this KB.","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.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/","og_locale":"en_US","og_type":"article","og_title":"MySQL Command Not Found? Here\u2019s How to Solve It","og_description":"This article explains how to Resolve- \"MySQL Command Not Found\" error. Follow the simple steps in this KB.","og_url":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2024-05-23T10:11:12+00:00","article_modified_time":"2026-02-26T14:02:11+00:00","author":"Serena","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Serena","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/"},"author":{"name":"Serena","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/ffd3f118493c99471ae5bd4790a55830"},"headline":"How to Resolve: MySQL Command Not Found","datePublished":"2024-05-23T10:11:12+00:00","dateModified":"2026-02-26T14:02:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/"},"wordCount":292,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["MySQL Command"],"articleSection":["SQL"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/","url":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/","name":"MySQL Command Not Found? Here\u2019s How to Solve It","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2024-05-23T10:11:12+00:00","dateModified":"2026-02-26T14:02:11+00:00","description":"This article explains how to Resolve- \"MySQL Command Not Found\" error. Follow the simple steps in this KB.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/how-to-resolve-mysql-command-not-found\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"SQL","item":"https:\/\/www.bodhost.com\/kb\/category\/sql\/"},{"@type":"ListItem","position":2,"name":"How to Resolve: MySQL Command Not Found"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/ffd3f118493c99471ae5bd4790a55830","name":"Serena","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","caption":"Serena"},"url":"https:\/\/www.bodhost.com\/kb\/author\/seema\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=13135"}],"version-history":[{"count":7,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13135\/revisions"}],"predecessor-version":[{"id":13184,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13135\/revisions\/13184"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=13135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=13135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=13135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}