{"id":1401,"date":"2024-05-08T10:15:14","date_gmt":"2024-05-08T02:15:14","guid":{"rendered":"http:\/\/oneai.eu.org\/?p=1401"},"modified":"2024-05-08T10:15:14","modified_gmt":"2024-05-08T02:15:14","slug":"mysql%e5%ae%89%e8%a3%85%e5%90%8e%e6%9d%83%e9%99%90%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/oneai.eu.org\/?p=1401","title":{"rendered":"mysql\u5b89\u88c5\u540e\u6743\u9650\u95ee\u9898"},"content":{"rendered":"<p>mysql&gt; use mysql<br \/>\nERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'mysql'<br \/>\nmysql&gt; exit<br \/>\nBye<br \/>\n[root@testtest ~]# service mysqld stop<br \/>\nStopping mysqld:                      [ OK ]<br \/>\n[root@testtest ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &amp; <\/p>\n<p>[root@testtest ~]# mysql -u root -p -hlocalhost<br \/>\nEnter password: <\/p>\n<p>mysql&gt; use mysql<\/p>\n<p>mysql&gt; SELECT host,user,password,Grant_priv,Super_priv FROM mysql.user;<\/p>\n<p>mysql&gt; UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';<\/p>\n<p>mysql&gt; FLUSH PRIVILEGES;<\/p>\n<p>mysql&gt; GRANT ALL PRIVILEGES ON <em>.<\/em> TO 'root'@'localhost' identified by '' WITH GRANT OPTION;<\/p>\n<p>mysql&gt; GRANT ALL PRIVILEGES ON <em>.<\/em> TO 'root'@'cn.cn.cn.cn'identified by '';<\/p>\n<p>mysql&gt; GRANT ALL PRIVILEGES ON <em>.<\/em> TO 'root'@'245.245.245.245'identified by '';<\/p>\n<p>mysql&gt; GRANT ALL PRIVILEGES ON <em>.<\/em> TO 'root'@'127.0.0.1' identified by '';<\/p>\n<p>mysql&gt; FLUSH PRIVILEGES;<\/p>\n<p>mysql&gt; quit<br \/>\nBye<br \/>\n[root@testtest ~]# service mysqld start <\/p>\n","protected":false},"excerpt":{"rendered":"<p>mysql&gt; use mysql ERROR 1044 (42000): Access denied for user &#8216;root&#8217;@&#8217;localhost&#8217; to database &#8216;mysql&#8217; mysql&gt; exit Bye [root@testtest ~]# service mysqld stop Stopping mysqld: [ OK ] [root@testtest ~]# mysqld_safe &#8211;user=mysql &#8211;skip-grant-tables &#8211;skip-networking &amp; [root@testtest ~]# mysql -u root -p -hlocalhost Enter password: mysql&gt; use mysql mysql&gt; SELECT host,user,password,Grant_priv,Super_priv FROM mysql.user; mysql&gt; UPDATE mysql.user SET Grant_priv=&#8217;Y&#8217;, Super_priv=&#8217;Y&#8217; WHERE User=&#8217;root&#8217;; mysql&gt; FLUSH PRIVILEGES; mysql&gt; GRANT ALL PRIVILEGES ON . TO &#8216;root&#8217;@&#8217;localhost&#8217; identified by &#8221; WITH GRANT OPTION; mysql&gt; GRANT ALL PRIVILEGES ON . TO &#8216;root&#8217;@&#8217;cn.cn.cn.cn&#8217;identified by &#8221;; mysql&gt; GRANT ALL PRIVILEGES ON . TO &#8216;root&#8217;@&#8217;245.245.245.245&#8217;identified by &#8221;; mysql&gt; GRANT ALL PRIVILEGES ON . TO &#8216;root&#8217;@&#8217;127.0.0.1&#8217; identified by &#8221;; mysql&gt; FLUSH PRIVILEGES; mysql&gt; quit Bye [root@testtest ~]# service mysqld start<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[83],"tags":[],"class_list":["post-1401","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1401"}],"version-history":[{"count":1,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1401\/revisions"}],"predecessor-version":[{"id":1402,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1401\/revisions\/1402"}],"wp:attachment":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}