{"id":5050,"date":"2021-06-15T17:56:17","date_gmt":"2021-06-16T00:56:17","guid":{"rendered":"http:\/\/blackcap.name\/blog\/new\/?p=5050"},"modified":"2021-06-15T17:56:17","modified_gmt":"2021-06-16T00:56:17","slug":"ubuntu-20-04-lts-installing-mysql","status":"publish","type":"post","link":"https:\/\/blackcap.name\/blog\/new\/?p=5050","title":{"rendered":"Ubuntu 20.04 LTS: Installing MySQL"},"content":{"rendered":"<p>This is probably going to be part of a series about the curve balls Ubuntu 20.04 LTS throws at the veteran Ubuntu Linux user.<\/p>\n<p>When you install MySQL with:<\/p>\n<pre>apt-get install mysql-client mysql-server<\/pre>\n<p>You will get an oddly-configured MySQL server that uses a newfangled thing called <code>auth_socket<\/code> authentication for the root user. The upshot is that you will not be able to log in to mysql as <code>root<\/code> unless you are already the <code>root<\/code> Linux user, and in the latter case you will <em>always<\/em> be able to log in, regardless of what password you supply, or even if you supply a password at all.<\/p>\n<p>If, like me, you are logged in as the <code>root<\/code> Linux user (and why wouldn&#8217;t you be, if you are doing a system install), then it appears as if authentication is completely disabled, and your mysql server&#8217;s <code>root<\/code> account is wide-open. At that point, you will try doing Internet searches to uncover the cause of the problem, and if you are like me, you will spend hours trying different keyword variations and finding exactly nothing pertinent.<\/p>\n<p>The fix is to change the <code>root<\/code> user to use <code>caching_sha2_password<\/code> authentication and set a password for it, e.g.:<\/p>\n<pre>ALTER USER 'root'@'localhost' IDENTIFIED WITH 'caching_sha2_password' BY 'iSpQ7U9c8kGz';\r\nFLUSH PRIVILEGES;<\/pre>\n<p>(And no, that is <em>not<\/em> my actual root password.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is probably going to be part of a series about the curve balls Ubuntu 20.04 LTS throws at the veteran Ubuntu Linux user. When you install MySQL with: apt-get install mysql-client mysql-server You will get an oddly-configured MySQL server that uses a newfangled thing called auth_socket authentication for the root user. The upshot is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-5050","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/posts\/5050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5050"}],"version-history":[{"count":0,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/posts\/5050\/revisions"}],"wp:attachment":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}