{"id":221720,"date":"2021-06-30T08:30:40","date_gmt":"2021-06-30T00:30:40","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=221720"},"modified":"2021-06-29T15:32:18","modified_gmt":"2021-06-29T07:32:18","slug":"freebsd-install-mysql","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/freebsd-install-mysql.html","title":{"rendered":"\u5982\u4f55\u5728FreeBSD 13\u4e2d\u5b89\u88c5MySQL\u6570\u636e\u5e93"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nMySQL \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93MySQL\u53ef\u4ee5\u5728 Linux\u3001Unix \u548cWindows\u7cfb\u7edf\u4e2d\u8fd0\u884c\uff0c\u5b83\u53ef\u7528\u4e8e\u591a\u79cd\u5e94\u7528\u7a0b\u5e8f\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u73af\u5883<\/strong><\/div>\n

FreeBSD 13-RELEASE<\/p>\n

\u4fee\u6539pkg\u6e90<\/strong><\/div>\n

\u9700\u8981\u5148\u521b\u5efa\/usr\/local\/etc\/pkg\/repos<\/code>\u76ee\u5f55\uff0c\u7136\u540e\u521b\u5efaFreeBSD.conf\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u5c06\u9ed8\u8ba4\u6e90\u5173\u95ed\uff0c\u7136\u540e\u6dfb\u52a0\u56fd\u5185\u8f6f\u4ef6\u6e90\u3002<\/p>\n

\r\nroot@freebsd:~ # mkdir -p \/usr\/local\/etc\/pkg\/repos\r\nroot@freebsd:~ # vi \/usr\/local\/etc\/pkg\/repos\/FreeBSD.conf\r\n\r\nFreeBSD: { enabled: no }\r\nustc: {\r\n  url: \"pkg+http:\/\/mirrors.ustc.edu.cn\/freebsd-pkg\/\/${ABI}\/quarterly\",\r\n  mirror_type: \"srv\",\r\n  signature_type: \"fingerprints\",\r\n  fingerprints: \"\/usr\/share\/keys\/pkg\",\r\n  enabled: yes\r\n}\r\n<\/pre>\n

\"\"
\n\u66f4\u65b0pkg\u6e90\uff1a<\/p>\n

\r\nroot@freebsd:~ # pkg update -f\r\nUpdating ustc repository catalogue...\r\nFetching meta.txz: 100%    916 B   0.9kB\/s    00:01    \r\nFetching packagesite.txz: 100%    6 MiB   6.5MB\/s    00:01    \r\nProcessing entries: 100%\r\nustc repository update completed. 30371 packages processed.\r\nAll repositories are up to date.\r\n<\/pre>\n

\"\"<\/p>\n

\u5b89\u88c5MySQL\u6570\u636e\u5e93<\/strong><\/div>\n

\u641c\u7d22\u4e00\u4e0bpkg\u6e90\u91cc\u9762\u6709\u54ea\u4e9b\u7248\u672c\u7684mysql\uff1a<\/p>\n

\r\nroot@freebsd:~ # pkg search \"^mysql\"\r\n<\/pre>\n

\"\"
\n\u4e0b\u9762\u5b89\u88c5mysql80\u7248\u672c\uff1a<\/p>\n

\r\nroot@freebsd:~ # pkg install -y mysql80-server mysql80-client\r\n<\/pre>\n

\"\"<\/p>\n

\u8fd0\u884cMySQL<\/strong><\/div>\n

\u63a5\u4e0b\u6765\u4f60\u5c06\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u8fd9\u4f1a\u5c06 MySQL \u670d\u52a1\u6dfb\u52a0\u5230 \/etc\/rc.conf<\/code>\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u5e76\u5f00\u673a\u542f\u52a8mysql\u3002<\/p>\n

\r\nroot@freebsd:~ # sysrc mysql_enable=yes\r\nmysql_enable:  -> yes\r\n<\/pre>\n

\"\"
\n\u542f\u52a8mysql\u670d\u52a1\uff1a<\/p>\n

\r\nroot@freebsd:~ # service mysql-server start\r\nStarting mysql.\r\n<\/pre>\n

\u67e5\u770b\u670d\u52a1\u72b6\u6001\u548cmysql\u76d1\u542c\u7684\u7aef\u53e3\uff1a<\/p>\n

\r\nroot@freebsd:~ # service mysql-server status\r\nmysql is running as pid 2194.\r\nroot@freebsd:~ # sockstat -4l\r\nUSER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      \r\nmysql    mysqld     2194  19 tcp46  *:33060               *:*\r\nmysql    mysqld     2194  24 tcp4   127.0.0.1:3306        *:*\r\nroot     sshd       802   4  tcp4   *:22                  *:*\r\nroot     sendmail   781   3  tcp4   127.0.0.1:25          *:*\r\nroot     syslogd    709   7  udp4   *:514                 *:*\r\n<\/pre>\n

\"\"<\/p>\n

\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/div>\n

\u8981\u9a8c\u8bc1\u5b89\u88c5\uff0c\u60a8\u53ef\u4ee5\u7528 root \u8eab\u4efd\u767b\u5f55\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u6570\u636e\u5e93\u7248\u672c\uff1a<\/p>\n

\r\nroot@freebsd:~ # mysqladmin -u root -p version\r\nEnter password: \r\nmysqladmin  Ver 8.0.25 for FreeBSD13.0 on amd64 (Source distribution)\r\nCopyright (c) 2000, 2021, Oracle and\/or its affiliates.\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\nServer version  8.0.25\r\nProtocol version 10\r\nConnection  Localhost via UNIX socket\r\nUNIX socket  \/tmp\/mysql.sock\r\nUptime:   4 min 16 sec\r\n\r\nThreads: 2  Questions: 6  Slow queries: 0  Opens: 138  Flush tables: 3  Open tables: 54  Queries per second avg: 0.023\r\n<\/pre>\n

\"\"<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u5230\u76ee\u524dMySQL 8 \u5df2\u5b89\u88c5\u5e76\u8fd0\u884c\u5728 FreeBSD 13\u4e0a\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

FreeBSD 13-RELEASE \u9700\u8981\u5148\u521b\u5efa\/usr\/local\/etc\/pkg\/repos\u76ee\u5f55\uff0c\u7136\u540e\u521b\u5efa […]<\/p>\n","protected":false},"author":309,"featured_media":221722,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-221720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=221720"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221720\/revisions"}],"predecessor-version":[{"id":221729,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221720\/revisions\/221729"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/221722"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=221720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=221720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=221720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}