\u76f4\u63a5\u4f7f\u7528 mysql \u547d\u4ee4\u767b\u5f55 MySQL5.7 \u6570\u636e\u5e93\u5e76\u4fee\u6539 root \u767b\u5f55\u5bc6\u7801<\/strong><\/div>\n\r\n[root@MySQL1 ~]# mysql\r\nWelcome to the MySQL monitor. Commands end with ; or \\g.\r\nYour MySQL connection id is 3\r\nServer version: 5.7.19-log Source distribution\r\n\r\nCopyright (c) 2000, 2017, Oracle and\/or its affiliates. All rights reserved.\r\n\r\nOracle is a registered trademark of Oracle Corporation and\/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nmysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';\r\nERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement\r\nmysql> flush privileges;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql> quit\r\nBye\r\n\r\n<\/pre>\n\u6ce8\u610f\uff1a\u5982\u679c\u5728\u6267\u884c\u8be5\u6b65\u9aa4\u7684\u65f6\u5019\u51fa\u73b0 ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement \u9519\u8bef\u3002\u5219\u6267\u884c\u4e0b flush privileges; \u547d\u4ee4\uff0c\u518d\u6267\u884c\u8be5\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n
\u4f7f\u7528\u65b0\u5bc6\u7801\u00a0password\u00a0\u767b\u5f55 MySQL5.7 \u6570\u636e\u5e93<\/strong><\/div>\n\r\n[root@MySQL1 ~]# mysql -uroot -ppassword\r\nmysql: [Warning] Using a password on the command line interface can be insecure.\r\nWelcome to the MySQL monitor. Commands end with ; or \\g.\r\nYour MySQL connection id is 4\r\nServer version: 5.7.19-log Source distribution\r\n\r\nCopyright (c) 2000, 2017, Oracle and\/or its affiliates. All rights reserved.\r\n\r\nOracle is a registered trademark of Oracle Corporation and\/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nmysql> exit\r\nBye\r\n<\/pre>\n\u4f7f\u7528\u5176\u4ed6\u5bc6\u7801\u4e0d\u80fd\u767b\u5f55 MySQL5.7 \u6570\u636e\u5e93<\/strong><\/div>\n\r\n[root@MySQL1 ~]# mysql -uroot -ppasswordd\r\nmysql: [Warning] Using a password on the command line interface can be insecure.\r\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)\r\n<\/pre>\n\u4f18\u5316<\/strong><\/div>\n\u5220\u6389 \/etc\/my.cnf \u91cc\u7684 skip-grant-tables <\/strong><\/span><\/div>\n\r\n[root@MySQL1 ~]# sed -i -e '\/skip-grant-tables\/d' \/etc\/my.cnf\r\n<\/pre>\n\u91cd\u542f\u6570\u636e\u5e93 <\/strong><\/div>\n\r\n[root@MySQL1 ~]# \/etc\/init.d\/mysqld restart\r\n<\/pre>\n\u603b\u7ed3<\/strong><\/div>\n\u4ee5\u4e0a\u5c31\u662f\u7834\u89e3 MySQL5.7 \u6570\u636e\u5e93\u7684 root \u767b\u5f55\u5bc6\u7801\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u80fd\u7ed9\u5927\u5bb6\u5e26\u6765\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
[root@MySQL1 ~]# mysql -uroot -p1231234 mysql: [Warning […]<\/p>\n","protected":false},"author":63,"featured_media":180672,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-180666","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/180666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=180666"}],"version-history":[{"count":5,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/180666\/revisions"}],"predecessor-version":[{"id":180814,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/180666\/revisions\/180814"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/180672"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=180666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=180666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=180666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}