{"id":1874,"date":"2018-06-18T11:24:44","date_gmt":"2018-06-18T15:24:44","guid":{"rendered":"http:\/\/www.insidethe.com\/blog\/?p=1874"},"modified":"2018-06-18T11:24:44","modified_gmt":"2018-06-18T15:24:44","slug":"cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client","status":"publish","type":"post","link":"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/","title":{"rendered":"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client"},"content":{"rendered":"<p>Taken from\u00a0https:\/\/askubuntu.com\/questions\/773446\/unable-to-connect-via-mysql-workbench-to-localhost-in-ubuntu-16-04-passwordless\/781136#781136 for my own reference:<\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<div class=\"votecell post-layout--left\" style=\"color: #111111;\">\n<div class=\"vote\" style=\"font-weight: inherit; font-style: inherit;\">The issue is likely due to socket authentication being enabled for the root user by default when no password is set, during the upgrade to 16.04. This important caveat is documented in the 16.04\u00a0<a style=\"font-weight: inherit; font-style: inherit; color: #962d0c;\" href=\"https:\/\/wiki.ubuntu.com\/XenialXerus\/ReleaseNotes#MySQL_5.7\" rel=\"noreferrer\">release notes<\/a>:<\/div>\n<\/div>\n<div class=\"answercell post-layout--right\" style=\"color: #111111;\">\n<div class=\"post-text\" style=\"font-weight: inherit; font-style: inherit;\">\n<blockquote style=\"font-weight: inherit; font-style: inherit;\">\n<p style=\"font-weight: inherit; font-style: inherit;\">Password behaviour when the MySQL root password is empty has changed. Packaging now enables socket authentication when the MySQL root password is empty. This means that a non-root user can&#8217;t log in as the MySQL root user with an empty password.<\/p>\n<\/blockquote>\n<p style=\"font-weight: inherit; font-style: inherit;\">For whatever reason, the MySQL Workbench that came with 16.04 doesn&#8217;t work out of the box with MySQL server, at least for me. I tried using &#8220;Local Socket\/Pipe&#8221; to connect in a number of different ways but to no avail.<\/p>\n<p style=\"font-weight: inherit; font-style: inherit;\"><strong style=\"font-style: inherit;\">The solution is to revert back to native password authentication.<\/strong>\u00a0You can do this by logging in to MySQL using socket authentication by doing:<\/p>\n<p style=\"font-weight: inherit; font-style: inherit;\"><code style=\"font-weight: inherit; font-style: inherit;\">sudo mysql -u root<\/code><\/p>\n<p style=\"font-weight: inherit; font-style: inherit;\">Once logged in:<\/p>\n<pre style=\"font-weight: inherit; font-style: inherit;\"><code style=\"font-weight: inherit; font-style: inherit;\">ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';\r\n<\/code><\/pre>\n<p style=\"font-weight: inherit; font-style: inherit;\">which will revert back to the native (old default) password authentication. If you&#8217;ve attempted some other method to fix the issue, you&#8217;ll want to make sure the &#8220;plugin&#8221; field in mysql.user is set to &#8220;auth_token&#8221;, which may require using mysqld_safe to log in to MySQL in the event you&#8217;ve been tinketing with things, like I did.<\/p>\n<p style=\"font-weight: inherit; font-style: inherit;\"><em style=\"font-weight: inherit;\">Credit to\u00a0<a style=\"font-weight: inherit; font-style: inherit; color: #962d0c;\" href=\"https:\/\/www.percona.com\/blog\/2016\/03\/16\/change-user-password-in-mysql-5-7-with-plugin-auth_socket\/\" rel=\"noreferrer\">Miguel Nieto&#8217;s blog post<\/a>\u00a0for this solution.<\/em><\/p>\n<\/div>\n<\/div>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Taken from\u00a0https:\/\/askubuntu.com\/questions\/773446\/unable-to-connect-via-mysql-workbench-to-localhost-in-ubuntu-16-04-passwordless\/781136#781136 for my own reference: &nbsp; The issue is likely due to socket authentication being enabled for the root user by default when no password is set, during the upgrade to 16.04. This important caveat is documented in the 16.04\u00a0release notes: Password behaviour when the MySQL root password is empty has changed. Packaging now [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[31],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cannot connect with MySQL Workbench but can connect from shell with mysql command line client - Insidethe.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client - Insidethe.com\" \/>\n<meta property=\"og:description\" content=\"Taken from\u00a0https:\/\/askubuntu.com\/questions\/773446\/unable-to-connect-via-mysql-workbench-to-localhost-in-ubuntu-16-04-passwordless\/781136#781136 for my own reference: &nbsp; The issue is likely due to socket authentication being enabled for the root user by default when no password is set, during the upgrade to 16.04. This important caveat is documented in the 16.04\u00a0release notes: Password behaviour when the MySQL root password is empty has changed. Packaging now [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/\" \/>\n<meta property=\"og:site_name\" content=\"Insidethe.com\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-18T15:24:44+00:00\" \/>\n<meta name=\"author\" content=\"Jared\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jared\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/\",\"url\":\"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/\",\"name\":\"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client - Insidethe.com\",\"isPartOf\":{\"@id\":\"https:\/\/insidethe.com\/blog\/#website\"},\"datePublished\":\"2018-06-18T15:24:44+00:00\",\"dateModified\":\"2018-06-18T15:24:44+00:00\",\"author\":{\"@id\":\"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99\"},\"breadcrumb\":{\"@id\":\"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/insidethe.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/insidethe.com\/blog\/#website\",\"url\":\"https:\/\/insidethe.com\/blog\/\",\"name\":\"Insidethe.com\",\"description\":\"It is my space, but better than myspace\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/insidethe.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99\",\"name\":\"Jared\",\"sameAs\":[\"https:\/\/www.insidethe.com\/blog\"],\"url\":\"https:\/\/insidethe.com\/blog\/author\/jared\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client - Insidethe.com","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:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/","og_locale":"en_US","og_type":"article","og_title":"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client - Insidethe.com","og_description":"Taken from\u00a0https:\/\/askubuntu.com\/questions\/773446\/unable-to-connect-via-mysql-workbench-to-localhost-in-ubuntu-16-04-passwordless\/781136#781136 for my own reference: &nbsp; The issue is likely due to socket authentication being enabled for the root user by default when no password is set, during the upgrade to 16.04. This important caveat is documented in the 16.04\u00a0release notes: Password behaviour when the MySQL root password is empty has changed. Packaging now [&hellip;]","og_url":"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/","og_site_name":"Insidethe.com","article_published_time":"2018-06-18T15:24:44+00:00","author":"Jared","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jared","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/","url":"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/","name":"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client - Insidethe.com","isPartOf":{"@id":"https:\/\/insidethe.com\/blog\/#website"},"datePublished":"2018-06-18T15:24:44+00:00","dateModified":"2018-06-18T15:24:44+00:00","author":{"@id":"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99"},"breadcrumb":{"@id":"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/insidethe.com\/blog\/2018\/06\/cannot-connect-with-mysql-workbench-but-can-connect-from-shell-with-mysql-command-line-client\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/insidethe.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Cannot connect with MySQL Workbench but can connect from shell with mysql command line client"}]},{"@type":"WebSite","@id":"https:\/\/insidethe.com\/blog\/#website","url":"https:\/\/insidethe.com\/blog\/","name":"Insidethe.com","description":"It is my space, but better than myspace","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/insidethe.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99","name":"Jared","sameAs":["https:\/\/www.insidethe.com\/blog"],"url":"https:\/\/insidethe.com\/blog\/author\/jared\/"}]}},"_links":{"self":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts\/1874"}],"collection":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/comments?post=1874"}],"version-history":[{"count":1,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts\/1874\/revisions"}],"predecessor-version":[{"id":1875,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts\/1874\/revisions\/1875"}],"wp:attachment":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/media?parent=1874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/categories?post=1874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/tags?post=1874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}