{"id":16525,"date":"2012-07-20T09:47:20","date_gmt":"2012-07-20T07:47:20","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=16525"},"modified":"2012-07-20T09:54:52","modified_gmt":"2012-07-20T07:54:52","slug":"workaround-for-cygwin-path-issues","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2012\/07\/20\/workaround-for-cygwin-path-issues\/","title":{"rendered":"Workaround for Cygwin path issues"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>A colleague of mine had a problem with his Cygwin setup. \u00a0For some reason, he couldn&#8217;t just run &#8220;<em>mysql<\/em>&#8221; to start his MySQL command-line client. \u00a0The error that he was getting back was:<\/p>\n<pre class=\"brush: bash; light: true; title: ; notranslate\" title=\"\">\r\n$ mysql\r\nsh.exe: mysql.exe: command not found\r\n<\/pre>\n<p>Typing the full path to mysql.exe every time is more than annoying. \u00a0After searching the web for a bit, I learned that the problem might be with the msys\/cygwin terminal, which doesn&#8217;t like the backslashes that Windows uses in the PATH variable. I&#8217;ve tried a few different variations of setting up the path, but eventually gave up. It just didn&#8217;t work.<\/p>\n<p>But since there is more than one way to do it, I solved the problem in a completely different way &#8211; an alias. \u00a0Just edit the .bashrc file and add the following line:<\/p>\n<pre class=\"brush: bash; light: true; title: ; notranslate\" title=\"\">\r\nalias mysql=&quot;\/c\/full\/path\/to\/your\/mysql.exe&quot;\r\n<\/pre>\n<p>Obviously, replace the fake path with the full path to your mysql.exe and restart the terminal. \u00a0From now on, every time you type &#8220;<em>mysql<\/em>&#8220;, it&#8217;ll be like you&#8217;ve typed the whole thing again.<\/p>\n<p>P.S.: The same solution is applicable to the other similar problems.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>A colleague of mine had a problem with his Cygwin setup. \u00a0For some reason, he couldn&#8217;t just run &#8220;mysql&#8221; to start his MySQL command-line client. \u00a0The error that he was getting back was: $ mysql sh.exe: mysql.exe: command not found Typing the full path to mysql.exe every time is more than annoying. \u00a0After searching the &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2012\/07\/20\/workaround-for-cygwin-path-issues\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Workaround for Cygwin path issues<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,133,62],"tags":[1960,3064,2077,3066],"keyring_services":[],"class_list":["post-16525","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-sysadmin","category-technology","tag-command-line","tag-cygwin","tag-microsoft-windows","tag-mysql"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":16290,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/05\/21\/github-for-windows\/","url_meta":{"origin":16525,"position":0},"title":"GitHub for Windows","author":"Leonid Mamchenkov","date":"May 21, 2012","format":false,"excerpt":"To all my friends and colleagues who choose to or are forced to suffer coding in Windows environment, here comes GitHub for Windows. \u00a0No more Cygwin installs, SSH key management, and command line interfaces - all as I'm sure you want.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2012\/05\/GitHub-for-Windows-500x292.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":28909,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/11\/04\/mycli-mysql-command-line-client-with-auto-completion\/","url_meta":{"origin":16525,"position":1},"title":"mycli &#8211; MySQL command line client with auto-completion","author":"Leonid Mamchenkov","date":"November 4, 2018","format":false,"excerpt":"mycli is a MySQL \/ MariaDB \/ Pecona database command line client with syntax highlighting and auto-completion.\u00a0 Have a look at some of the screenshots and documentation for features. Found via this StackOverflow discussion.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/11\/mycli-500x181.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":27094,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/12\/10\/taking-the-pain-out-of-mysql-schema-changes\/","url_meta":{"origin":16525,"position":2},"title":"Taking the Pain Out of MySQL Schema Changes","author":"Leonid Mamchenkov","date":"December 10, 2016","format":false,"excerpt":"\"Taking the Pain Out of MySQL Schema Changes\" covers the following approaches to deploying MySQL schema changes: Schema Change in Downtime Role Swap (cluster setup) pt-online-schema-change The last one is the usage of\u00a0pt-online-schema-change tool developed by Percona guys, as part of their Percona Toolkit - an Open Source set of\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28287,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/12\/20\/mysql-optimize-repair-and-analyze\/","url_meta":{"origin":16525,"position":3},"title":"MySQL optimize, repair, and analyze","author":"Leonid Mamchenkov","date":"December 20, 2017","format":false,"excerpt":"Years ago I had the following script running as a cron job, but then I lost it somewhere.\u00a0 It took me a few minutes to find it again, but just in case I need it in the future, I'm saving it here. [code light=\"true\" lang=\"bash\"] #!\/bin\/bash mysqlcheck --all-databases mysqlcheck --all-databases\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16921,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/11\/19\/i-am-a-dummy\/","url_meta":{"origin":16525,"position":4},"title":"&#8211;i-am-a-dummy","author":"Leonid Mamchenkov","date":"November 19, 2012","format":false,"excerpt":"Here is a handy command-line option for MySQL client: --i-am-a-dummy, or, if you don't have a sense of humor, --safe-updates. \u00a0When used, this will prevent updating or deleting rows without\u00a0explicitly\u00a0specifying a WHERE clause. \u00a0It will also limit the number of SELECT and JOIN results.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26687,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/09\/14\/mysql-php-and-integrity-constraint-violation-1062-duplicate-entry\/","url_meta":{"origin":16525,"position":5},"title":"MySQL, PHP and &#8220;Integrity constraint violation: 1062 Duplicate entry&#8221;","author":"Leonid Mamchenkov","date":"September 14, 2016","format":false,"excerpt":"Anna Filina blogs about an interesting problem she encountered with when working on a PHP and MySQL project: MySQL was complaining about \u201cIntegrity constraint violation: 1062 Duplicate entry\u201d. I had all the necessary safeguards in my code to prevent duplicates in tha column. I gave up on logic and simply\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/16525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=16525"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/16525\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=16525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=16525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=16525"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=16525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}