{"id":5607,"date":"2016-03-31T11:49:41","date_gmt":"2016-03-31T03:49:41","guid":{"rendered":"http:\/\/rmohan.com\/?p=5607"},"modified":"2016-03-31T11:50:00","modified_gmt":"2016-03-31T03:50:00","slug":"centos-7-used-rpm-install-mysql-5-7","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5607","title":{"rendered":"CentOS 7 used rpm install MySQL 5.7"},"content":{"rendered":"<p>$\u00a0 wget http:\/\/repo.mysql.com\/mysql57-community-release-el7-7.noarch.rpm<\/p>\n<p>$ rpm -ivh mysql57-community-release-el7-7.noarch.rpm<\/p>\n<p>[root@cluster1 ~]# rpm -ivh mysql57-community-release-el7-7.noarch.rpm<br \/>\nwarning: mysql57-community-release-el7-7.noarch.rpm: Header V3 DSA\/SHA1 Signature, key ID 5072e1f5: NOKEY<br \/>\nPreparing&#8230;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ########################################### [100%]<br \/>\n1:mysql57-community-relea########################################### [100%]<\/p>\n<p>$\u00a0 yum install mysql-server<\/p>\n<p>So far, mysql57 has been successfully installed. Now try to log on to use the root mysql, an error ERROR 1045 (28000): Access denied for user &#8216;root&#8217; @ &#8216;localhost&#8217;<\/p>\n<p>This problem occurs because the occurrence is estimated rpm mode after installing mysql default password used to initialize the root user.<\/p>\n<p>After the degree of your mother get Google solution for 5.7.x version is invalid. The official website to find some ideas https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/server-management-using-systemd.html<\/p>\n<p>mysql5.7.x version has some new changes, roughly<\/p>\n<p>1.mysqld_safe has been abandoned, rpm installation package is not installed by default mysqld_safe<\/p>\n<p>2.user table password column has been changed to authentication_string<\/p>\n<p>After many tests and finally solve the root login issues. Resolve as follows<\/p>\n<p>$\u00a0 systemctl stop mysqld.service<\/p>\n<p>$\u00a0 systemctl set-environment MYSQLD_OPTS=&#8221;&#8211;user=mysql &#8211;skip-grant-tables &#8211;skip-networking&#8221;<\/p>\n<p>$\u00a0 systemctl start mysqld.service<\/p>\n<p>$ mysql -u root mysql<\/p>\n<p>mysql &gt; UPDATE mysql.user SET authentication_string=PASSWORD(&#8220;mohan123&#8221;)\u00a0 WHERE user=&#8217;root&#8217; and host=&#8217;localhost&#8217;;<\/p>\n<p>mysql &gt; flush privileges;<\/p>\n<p>mysql &gt; quit<\/p>\n<p>$\u00a0 systemctl unset-environment MYSQLD_OPTS<\/p>\n<p>$\u00a0 systemctl restart mysqld.service<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$ wget http:\/\/repo.mysql.com\/mysql57-community-release-el7-7.noarch.rpm<\/p>\n<p>$ rpm -ivh mysql57-community-release-el7-7.noarch.rpm<\/p>\n<p>[root@cluster1 ~]# rpm -ivh mysql57-community-release-el7-7.noarch.rpm warning: mysql57-community-release-el7-7.noarch.rpm: Header V3 DSA\/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing&#8230; ########################################### [100%] 1:mysql57-community-relea########################################### [100%]<\/p>\n<p>$ yum install mysql-server<\/p>\n<p>So far, mysql57 has been successfully installed. Now try to log on to use the root mysql, an error ERROR 1045 (28000): Access denied [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,1],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5607"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5607"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5607\/revisions"}],"predecessor-version":[{"id":5609,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5607\/revisions\/5609"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}