{"id":291,"date":"2024-11-15T19:27:24","date_gmt":"2024-11-15T11:27:24","guid":{"rendered":"https:\/\/telaker.cn\/?p=291"},"modified":"2024-11-17T10:40:10","modified_gmt":"2024-11-17T02:40:10","slug":"mysql-01-2","status":"publish","type":"post","link":"https:\/\/telaker.cn\/index.php\/2024\/11\/15\/mysql-01-2\/","title":{"rendered":"\u5b89\u88c5MySQL"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u7cfb\u7edf\u73af\u5883<\/h2>\n\n\n\n<p>windows\u4e2d\u7684WSL\uff0c\u7248\u672c\u662fUbuntu22.04<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u547d\u4ee4<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\napt install mysql-server<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u767b\u5f55\u662f\u6ca1\u6709\u5bc6\u7801\u7684\uff0c\u4f46\u5fc5\u9700\u4f7f\u7528root\u7528\u6237\u6743\u9650<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql -u root -p<\/code><\/pre>\n\n\n\n<p>\u767b\u5f55\u6210\u529f\uff0c\u5148\u66f4\u6539\u5bc6\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; USE mysql;\nmysql&gt; desc user;\nmysql&gt; SELECT user, authentication_string FROM user;\nmysql&gt; UPDATE user SET authentication_string = PASSWORD('new_password') WHERE user = 'root';\n#mysql&gt; ALTER USER 'root'@'localhost' IDENTIFIED BY '\u65b0\u5bc6\u7801';\nmysql&gt; FLUSH PRIVILEGES;\nmysql&gt; exit;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u91cd\u542fMySQL\uff0c\u8fdb\u884c\u5b89\u5168\u8bbe\u7f6e\nsudo service mysql restart\nsudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u4e9b\u53c2\u8003\u6587\u7ae0<\/h2>\n\n\n\n<p><a href=\"https:\/\/blog.csdn.net\/LIU_ZHAO_YANG\/article\/details\/135628320\">Linux \u5b89\u88c5MySQL<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.cnblogs.com\/mant\/articles\/17623533.html\">Linux\u4e2dMySQL\u5bc6\u7801\u4fee\u6539 <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u7edf\u73af\u5883 windows\u4e2d\u7684WSL\uff0c\u7248\u672c\u662fUbuntu22.04 \u547d\u4ee4 \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u767b\u5f55\u662f\u6ca1\u6709\u5bc6\u7801\u7684\uff0c\u4f46\u5fc5\u9700\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[26],"class_list":["post-291","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-mysql"],"_links":{"self":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts\/291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/comments?post=291"}],"version-history":[{"count":0,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts\/291\/revisions"}],"wp:attachment":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/media?parent=291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/categories?post=291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/tags?post=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}