{"id":359,"date":"2025-10-28T12:45:18","date_gmt":"2025-10-28T04:45:18","guid":{"rendered":"http:\/\/www.bigqq.com\/?p=359"},"modified":"2025-11-05T15:01:35","modified_gmt":"2025-11-05T07:01:35","slug":"ubuntu-%e5%ae%89%e8%a3%85mysql8-0-%e5%b9%b6%e4%bb%8e5-7%e5%a4%87%e4%bb%bd%e8%bf%98%e5%8e%9f","status":"publish","type":"post","link":"http:\/\/www.bigqq.com\/?p=359","title":{"rendered":"ubuntu \u5b89\u88c5mysql8.0 \u5e76\u4ece5.7\u5907\u4efd\u8fd8\u539f"},"content":{"rendered":"\n<p><a href=\"https:\/\/blog.csdn.net\/linzuo7096\/article\/details\/151756514\">https:\/\/blog.csdn.net\/linzuo7096\/article\/details\/151756514<\/a><\/p>\n\n\n\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 \/etc\/mysql\/mysql.conf.d\/mysqld.cnf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u5f00\u653e\u76d1\u542c\nvim \/etc\/mysql\/mysql.conf.d\/mysqld.cnf\n\u5c06bind-address = 127.0.0.1\u6ce8\u9500\u200b \u6216\u6539\u4e3a0.0.0.0\n\u67e5\u770bSHOW VARIABLES LIKE 'bind_address';\n\u6ce8\u610f\/etc\/mysql\/mysql.conf.d\/mysqld_bak.cnf\u7c7b\u4f3c\u7684\u914d\u7f6e\u6587\u4ef6\u5bf9\u76d1\u542c\u6709\u5f71\u54cd\n\n\/\/\u6dfb\u52a0\u65b0\u8d26\u6237\ncreate user 'wflow'@'%' identified by 'wflowxxx';\ngrant all on wflow_prd.* to wflow@'%';\nGRANT PROCESS ON *.* TO wflow@'%';<\/code><\/pre>\n\n\n\n<p>DBeaver JDBC URL \u4e2d\u6dfb\u52a0\u53c2\u6570&nbsp;<code>allowPublicKeyRetrieval=true<\/code><\/p>\n\n\n\n<p>\u8fd8\u539f\u6570\u636e\u5e93\u65f6 \u6dfb\u52a0\u5b57\u7b26\u96c6\u53c2\u6570 &#8211;default-character-set=utf8<\/p>\n\n\n\n<p>\u5907\u4efd\u811a\u672cbackup.sh<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n# MySQL\u5907\u4efd\u811a\u672c\nUSER=\"wflow\"\nPASS=\"wflowxxxx\"\nDBNAME=\"wflow_prd\"\nBACKUP_DIR=\"\/mesdata\/wflow_bak\/backup\"\nDATE=$(date +%Y%m%d_%H%M%S)\nFILE_NAME=\"$DBNAME-$DATE.sql\"\nFULL_PATH=\"$BACKUP_DIR\/$FILE_NAME\"\n\n# \u521b\u5efa\u5907\u4efd\u76ee\u5f55\uff08\u5982\u679c\u4e0d\u5b58\u5728\uff09\nmkdir -p $BACKUP_DIR\n\n# \u6267\u884c\u5907\u4efd\u547d\u4ee4\nmysqldump -u$USER -p$PASS $DBNAME &gt; $FULL_PATH\n\n# \u53ef\u9009\uff1a\u538b\u7f29\u5907\u4efd\u6587\u4ef6\u4ee5\u8282\u7701\u7a7a\u95f4\ngzip $FULL_PATH<\/code><\/pre>\n\n\n\n<p>\u5b9a\u65f6\u4efb\u52a1crontab -e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0 3 * * * \/mesdata\/wflow_bak\/backup.sh\n0 4 * * * find \/mesdata\/wflow_bak\/backup -type f -name \"*.sql\" -mtime +10 -exec rm {} \\;<\/code><\/pre>\n\n\n\n<p>\u91cd\u65b0\u521d\u59cb\u5316\uff0c\u521d\u59cb\u5316root\u5bc6\u7801\u53ef\u4ee5\u5728\/var\/log\/mysql\u4e2d\u770b\u5230\uff0c\u6216\u8005\u52a0&#8211;console<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysqld --initialize --datadir=\/mesdata\/mysql --console\n\u6ce8\u610fdatadir\u76ee\u5f55\u9700\u8981\u5c06\u6743\u9650\u7ed9mysql\u7528\u6237\nchown mysql:mysql \/mesdata\/mysql<\/code><\/pre>\n\n\n\n<p>mysql\u5927\u5c0f\u5199\u654f\u611f\u95ee\u9898<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u67e5\u770bSHOW VARIABLES LIKE 'lower_case_table_names';\n\u914d\u7f6evim \/etc\/mysql\/mysql.conf.d\/mysqld.cnf \u589e\u52a0lower_case_table_names=1<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/blog.csdn.ne [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts\/359"}],"collection":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=359"}],"version-history":[{"count":7,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts\/359\/revisions"}],"predecessor-version":[{"id":373,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts\/359\/revisions\/373"}],"wp:attachment":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}