{"id":13716,"date":"2025-04-18T20:38:23","date_gmt":"2025-04-18T12:38:23","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/13716.html"},"modified":"2025-04-18T20:38:23","modified_gmt":"2025-04-18T12:38:23","slug":"%e7%89%a9%e8%81%94%e7%bd%91%e5%85%a5%e9%97%a8-%e4%b8%8b%e8%bd%bdemqx%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8emysql","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/13716.html","title":{"rendered":"\u7269\u8054\u7f51\u5165\u95e8----\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql"},"content":{"rendered":"<h2>\u4e00\u3001EMQX\u7684\u4e0b\u8f7d\u53ca\u914d\u7f6e<\/h2>\n<p>\u5728\u865a\u62df\u673a\u4e0b\u8f7d\u8d44\u6e90\u4e4b\u524d&#xff0c;\u6211\u4eec\u9700\u8981\u5148\u6362\u6e90\u4fdd\u8bc1\u4e0b\u8f7d\u901f\u5ea6&#xff1a;<\/p>\n<p>\u5907\u4efdrepo\u6587\u4ef6<br \/>\nsudo cp -r \/etc\/yum.repos.d \/etc\/yum.repos.d.backup<\/p>\n<p>\u5220\u9664\u539f\u6765\u6587\u4ef6<br \/>\nsudo rm -f \/etc\/yum.repos.d\/*.repo<\/p>\n<p>\u521b\u5efa\u65b0\u7684repo\u6587\u4ef6\u5e76\u6362\u963f\u91cc\u4e91\u7684\u6e90<br \/>\nsudo bash -c &#039;cat &gt; \/etc\/yum.repos.d\/CentOS-Base.repo &lt;&lt;EOF<br \/>\n[base]<br \/>\nname&#061;CentOS-$releasever &#8211; Base<br \/>\nbaseurl&#061;http:\/\/mirrors.aliyun.com\/centos\/$releasever\/os\/$basearch\/<br \/>\ngpgcheck&#061;1<br \/>\ngpgkey&#061;http:\/\/mirrors.aliyun.com\/centos\/$releasever\/os\/$basearch\/RPM-GPG-KEY-CentOS7<br \/>\nenabled&#061;1<br \/>\n[updates]<br \/>\nname&#061;CentOS-$releasever &#8211; Updates<br \/>\nbaseurl&#061;http:\/\/mirrors.aliyun.com\/centos\/$releasever\/updates\/$basearch\/<br \/>\ngpgcheck&#061;1<br \/>\ngpgkey&#061;http:\/\/mirrors.aliyun.com\/centos\/$releasever\/updates\/$basearch\/RPM-GPG-KEY-CentOS7<br \/>\nenabled&#061;1<br \/>\n[extras]<br \/>\nname&#061;CentOS-$releasever &#8211; Extras<br \/>\nbaseurl&#061;http:\/\/mirrors.aliyun.com\/centos\/$releasever\/extras\/$basearch\/<br \/>\ngpgcheck&#061;1<br \/>\ngpgkey&#061;http:\/\/mirrors.aliyun.com\/centos\/$releasever\/extras\/$basearch\/RPM-GPG-KEY-CentOS7<br \/>\nenabled&#061;1<br \/>\nEOF&#039;<\/p>\n<p>\u66f4\u65b0\u7cfb\u7edf<br \/>\nsudo yum update -y <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"696\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123815-680247b785b20.png\" width=\"1196\" \/><\/p>\n<p>\u66f4\u65b0\u540e\u518d\u4e0b\u8f7d\u4f1a\u53d1\u73b0\u63d0\u793aGPG key\u9519\u8bef&#xff0c;\u8fd9\u91cc\u53ef\u4ee5\u5173\u95edgpgcheck&#xff0c;\u5728\u521a\u521a\u7684repo\u6587\u4ef6\u4fee\u6539&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"655\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123815-680247b7d48e4.png\" width=\"1170\" \/><\/p>\n<p>\u5c06repo\u6587\u4ef6\u4e2d\u6bcf\u4e2agpgcheck\u6539\u4e3a0<\/p>\n<\/p>\n<p>Download EMQX Open Source\u5728\u8fd9\u4e2a\u7f51\u9875\u4e0b\u8f7d\u670d\u52a1\u5668<\/p>\n<p>\u6ce8\u610fInstall the dependencies\u65f6\u8981\u52a0sudo\u7ed9\u6743\u9650<\/p>\n<\/p>\n<p>emqx\u670d\u52a1\u5668\u7684dashboard\u9700\u8981\u5728\u7f51\u9875\u8fd0\u884c\u7684\u8bdd\u9700\u8981\u4fdd\u8bc1\u9632\u706b\u5899\u7aef\u53e3\u6253\u5f00&#xff0c;\u6709\u5173emqx\u7684\u7aef\u53e3\u6709\u56db\u4e2a&#xff0c;\u4f9d\u6b21\u6253\u5f00\u5e76\u91cd\u65b0\u52a0\u8f7d\u9632\u706b\u5899\u914d\u7f6e&#xff1a;<\/p>\n<p>sudo firewall-cmd &#8211;zone&#061;public &#8211;add-port&#061;1883\/tcp &#8211;permanent<br \/>\nsudo firewall-cmd &#8211;zone&#061;public &#8211;add-port&#061;8083\/tcp &#8211;permanent<br \/>\nsudo firewall-cmd &#8211;zone&#061;public &#8211;add-port&#061;8883\/tcp &#8211;permanent<br \/>\nsudo firewall-cmd &#8211;zone&#061;public &#8211;add-port&#061;18083\/tcp &#8211;permanent<\/p>\n<p>sudo firewall-cmd &#8211;reload <\/p>\n<p>\u5f00\u542femqx\u670d\u52a1\u5668\u540e\u53ef\u4ee5\u6253\u5f00emqx\u7684dashboard&#xff0c;\u5728\u7f51\u9875\u641c\u7d22http:\/\/{\u81ea\u5df1\u7684ip}:18083\u5c31\u53ef\u4ee5\u6253\u5f00<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1251\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123816-680247b82a8b4.png\" width=\"2148\" \/><\/p>\n<p>\u9996\u6b21\u767b\u5f55\u7684\u8d26\u53f7\u662fadmin&#xff0c;\u5bc6\u7801\u662fpublic&#xff0c;\u8fdb\u53bb\u540e\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539\u5bc6\u7801<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"954\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123817-680247b95b477.png\" width=\"1912\" \/><\/p>\n<p>\u767b\u5f55\u8fdb\u6765\u4e4b\u540e\u663e\u793a\u8fd9\u6837\u7684\u754c\u9762&#xff0c;\u663e\u793a\u7684\u662f\u6240\u6709\u8fde\u63a5\u7684\u4fe1\u606f\u53caemqx\u7684\u914d\u7f6e&#xff0c;\u53ef\u4ee5\u968f\u4fbf\u70b9\u70b9\u719f\u6089\u4e00\u4e0bemqx\u670d\u52a1\u5668\u7684\u529f\u80fd<\/p>\n<p>\u63a5\u4e0b\u6765\u9700\u8981\u4e0b\u8f7d\u4e00\u4e2a\u7528\u4e8e\u5efa\u7acb\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u8fde\u63a5\u7684\u5de5\u5177&#xff0c;\u6211\u9009\u7528\u7684\u662fMQTTX&#xff0c;\u53ef\u4ee5\u53d6\u5b98\u7f51\u81ea\u5df1\u4e0b\u4e00\u4e2a&#xff0c;\u4e0b\u597d\u4ee5\u540e\u521b\u5efa\u4e00\u4e2a\u5ba2\u6237\u7aef<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1124\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123818-680247ba00408.png\" width=\"1538\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u7684\u4fe1\u606f\u9664\u4e86Host\u4e0ePort\u5916\u5176\u4f59\u90fd\u53ef\u4ee5\u968f\u4fbf\u586b\u5199<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1038\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123818-680247babc9da.png\" width=\"1517\" \/><\/p>\n<p>Host\u4e3a\u670d\u52a1\u5668\u7684IP&#xff0c;\u4e5f\u5c31\u662f\u4f60\u865a\u62df\u5668\u7684IP&#xff0c;\u5728\u4e4b\u524d\u767b\u5f55dashboard\u7684IP\u662f\u4e00\u6837\u7684&#xff0c;\u914d\u7f6e\u597d\u8fd9\u4e9b\u4fe1\u606f\u5c31\u53ef\u4ee5\u8fde\u63a5&#xff0c;\u70b9\u51fb\u53f3\u4e0a\u89d2Connect<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1012\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123819-680247bb37ec4.png\" width=\"979\" \/><\/p>\n<p>\u8fde\u63a5\u6210\u529f&#xff0c;\u5e76\u4e14emqx\u670d\u52a1\u5668\u4e0a\u4e5f\u663e\u793a\u8fde\u63a5\u4e86\u4e00\u4e2a\u5ba2\u6237\u7aef&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"227\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123819-680247bb77bce.png\" width=\"1778\" \/><\/p>\n<p>\u4e3a\u4e86\u9632\u6b62\u5176\u4f59\u5ba2\u6237\u7aef\u7684\u8fde\u63a5&#xff0c;\u53ef\u4ee5\u8bbe\u7f6e\u8fde\u63a5\u65f6\u7684\u7528\u6237\u540d\u4e0e\u5bc6\u7801&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"436\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123819-680247bba7fc4.png\" width=\"324\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"954\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123819-680247bbbbe30.png\" width=\"1912\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"414\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123820-680247bc5d305.png\" width=\"908\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"365\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123820-680247bc82139.png\" width=\"1163\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"379\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123820-680247bcb0d96.png\" width=\"1353\" \/><\/p>\n<p>\u521b\u5efa\u540e\u70b9\u51fb\u8bbe\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"170\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123820-680247bcded5c.png\" width=\"1771\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"260\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123821-680247bd11f78.png\" width=\"1796\" \/><\/p>\n<p>\u70b9\u51fb\u7528\u6237\u7ba1\u7406\u4e0e\u521b\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"474\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123821-680247bd4622c.png\" width=\"541\" \/><\/p>\n<p>\u81ea\u5df1\u8bbe\u7f6e\u7528\u6237\u540d\u4e0e\u5bc6\u7801&#xff0c;\u81ea\u5df1\u8bbe\u7f6e\u662f\u5426\u4e3a\u8d85\u7ea7\u7528\u6237<\/p>\n<p>\u8bbe\u7f6e\u6210\u529f\u540e\u8fde\u63a5\u65f6\u5c31\u9700\u8981\u586b\u5199username\u4e0epassword\u4e86<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"578\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123821-680247bd5cc9a.png\" width=\"981\" \/><\/p>\n<p>\u81f3\u6b64MQTT\u7684\u914d\u7f6e\u53ca\u8fde\u63a5\u7ed3\u675f<\/p>\n<\/p>\n<h2>\u4e8c\u3001MySQL\u4e0b\u8f7d\u4e0e\u914d\u7f6e<\/h2>\n<p>\u5ba2\u6237\u7aef\u53ef\u4ee5\u548c\u670d\u52a1\u5668\u8fdb\u884c\u901a\u4fe1\u540e&#xff0c;\u6211\u4eec\u9700\u8981\u60f3\u529e\u6cd5\u5c06\u5ba2\u6237\u7aef\u7684\u6570\u636e\u5b58\u5165\u6570\u636e\u5e93&#xff0c;\u65b9\u4fbf\u540e\u7eed\u524d\u7aef\u540e\u7aef\u8fdb\u884c\u67e5\u770b&#xff0c;\u5728\u786c\u4ef6\u52a0\u5165\u4e4b\u524d&#xff0c;\u6211\u4eec\u5148\u7528mqttx\u521b\u5efa\u5ba2\u6237\u7aef\u66ff\u4ee3\u3002\u8fd9\u91cc\u9700\u8981\u4e0b\u8f7d\u6570\u636e\u5e93&#xff0c;windows\u7aef\u6211\u7528\u7684\u662fNavicat 17 for MySQL\u7248\u672c\u662f17.1.11&#xff0c;\u76f4\u63a5\u53d6\u5b98\u7f51\u4e0b\u5c31\u884c&#xff0c;\u670930\u5929\u514d\u8d39\u8bd5\u7528\u671f&#xff0c;\u8fd9\u91cc\u4e0d\u63d0\u4f9b\u7834\u89e3\u65b9\u5f0f&#xff0c;\u652f\u6301\u6b63\u7248\u3002\u4e0b\u8f7d\u597d\u540e\u5148\u653e\u4e00\u8fb9&#xff0c;\u6211\u4eec\u5c06\u6570\u636e\u5b58\u50a8\u5728\u670d\u52a1\u5668\u4e2d&#xff0c;\u6240\u4ee5\u8fd8\u9700\u8981\u5728\u670d\u52a1\u5668\u4e0a\u4e0b\u8f7d\u6570\u636e\u5e93\u5e76\u4e14\u65b0\u5efa\u8fde\u63a5\u3002<\/p>\n<p>\u5148\u5b89\u88c5MySQL\u7684\u5b58\u50a8\u5e93&#xff1a;<\/p>\n<p>\u200b<br \/>\nsudo rpm -Uvh https:\/\/repo.mysql.com\/mysql57-community-release-el7-11.noarch.rpm <\/p>\n<p>&#xff08;\u4e0a\u9762\u7684\u94fe\u63a5\u4e3aMySQL\u00a05.7\u7684\u793a\u4f8b&#xff0c;\u5982\u679c\u9700\u8981\u5176\u4ed6\u7248\u672c&#xff0c;\u8bf7\u8bbf\u95ee\u00a0MySQL\u7684\u5b98\u65b9\u5b58\u50a8\u5e93\u00a0\u83b7\u53d6\u5bf9\u5e94\u7248\u672c\u7684\u94fe\u63a5\u3002&#xff09;<\/p>\n<p>\u5b89\u88c5MySQL\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>sudo yum install mysql-community-server <\/p>\n<p>\u5b89\u88c5\u6b64\u6b65\u9aa4\u65f6\u53ef\u80fd\u4f1a\u51fa\u9519&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"533\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123821-680247bd87929.png\" width=\"1637\" \/><\/p>\n<p>\u8fd9\u4e2a\u9519\u8bef\u8868\u793a\u627e\u4e0d\u5230GPG\u516c\u94a5&#xff0c;\u53ef\u4ee5\u5148\u5bfc\u5165\u516c\u94a5&#xff1a;<\/p>\n<p>\u200b<br \/>\nsudo rpm &#8211;import https:\/\/repo.mysql.com\/RPM-GPG-KEY-mysql <\/p>\n<p>\u518d\u5c1d\u8bd5\u5b89\u88c5\u670d\u52a1\u5668<\/p>\n<p>sudo yum install mysql-community-server <\/p>\n<p>\u4f46\u5b89\u88c5\u540e\u53c8\u53d1\u751f\u9519\u8bef<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"381\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123821-680247bde6599.png\" width=\"1574\" \/><\/p>\n<p>\u8fd9\u4e2a\u9519\u8bef\u662f\u516c\u94a5\u4e0d\u5339\u914d\u6216\u8005\u4e0d\u6b63\u786e&#xff0c;\u6211\u4eec\u5148\u770b\u770b\u81ea\u5df1\u6709\u54ea\u4e9b\u516c\u94a5<\/p>\n<p>rpm -qa gpg-pubkey* <\/p>\n<p>\u7136\u540e\u6839\u636e\u9700\u8981\u5220\u9664\u516c\u94a5<\/p>\n<p>sudo rpm -e gpg-pubkey-3a79bd29 <\/p>\n<p>3a79bd29\u8868\u793aID&#xff0c;\u6211\u662f\u9009\u4e86\u5176\u4e2d\u4e00\u4e2a\u5220\u9664&#xff0c;\u6682\u65f6\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898<\/p>\n<p>\u7136\u540e\u91cd\u65b0\u5bfc\u5165\u516c\u94a5<\/p>\n<p>sudo rpm &#8211;import https:\/\/repo.mysql.com\/RPM-GPG-KEY-mysql <\/p>\n<p>\u66f4\u65b0YUM\u914d\u7f6e<\/p>\n<p>sudo vi \/etc\/yum.repos.d\/mysql-community.repo <\/p>\n<p>\u786e\u4fdd\u4f60\u7684\u914d\u7f6e\u662f\u8fd9\u6837<\/p>\n<p>[mysql57-community]<br \/>\nname&#061;MySQL 5.7 Community Server<br \/>\nbaseurl&#061;https:\/\/repo.mysql.com\/yum\/mysql-5.7-community\/el\/7\/x86_64\/<br \/>\nenabled&#061;1<br \/>\ngpgcheck&#061;1<br \/>\ngpgkey&#061;https:\/\/repo.mysql.com\/RPM-GPG-KEY-mysql <\/p>\n<p>\u5982\u679c\u4e0b\u8f7d\u4e2d\u5b58\u5728gpgcheck fail\u53ef\u4ee5\u9009\u62e9\u6027\u5c06\u5176\u503c\u6539\u4e3a0 \u4e0dcheck<\/p>\n<p>\u518d\u6e05\u7406YUM\u7f13\u5b58<\/p>\n<p>sudo yum clean all <\/p>\n<p>\u6700\u540e\u91cd\u65b0\u4e0b\u8f7d\u670d\u52a1\u5668<\/p>\n<p>sudo yum install mysql-community-server <\/p>\n<p>\u6700\u540e\u5b89\u88c5\u5b8c\u6210<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"483\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123822-680247be3a205.png\" width=\"1221\" \/><\/p>\n<p>\u9a8c\u8bc1\u5b89\u88c5\u5e76\u6dfb\u52a0\u81ea\u542f\u52a8&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"228\" src=\"2025-04-185nce3dtpctt.png\" width=\"550\" \/><\/p>\n<p>\u5728\u5b89\u88c5\u540eMySQL\u4f1a\u751f\u6210\u4e00\u4e2a\u4e34\u65f6\u5bc6\u7801&#xff0c;\u7b2c\u4e00\u6b21\u767b\u5f55\u9700\u8981\u8be5\u5bc6\u7801&#xff0c;\u901a\u8fc7\u4ee5\u4e0b\u6307\u4ee4\u53ef\u4ee5\u83b7\u5f97<\/p>\n<p>sudo grep &#039;temporary password&#039; \/var\/log\/mysqld.log <\/p>\n<p>\u7136\u540e\u767b\u5f55MySQL&#xff1a;<\/p>\n<p>mysql -u root -p <\/p>\n<p>\u8f93\u5165\u521a\u521a\u7684\u5bc6\u7801\u5c31\u884c\u4e86&#xff0c;\u7136\u540e\u767b\u5f55\u6210\u529f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"387\" src=\"2025-04-18ned4krjnuyf.png\" width=\"1005\" \/><\/p>\n<p>\u767b\u5f55\u8fdb\u53bb\u4ee5\u540e\u4f60\u53ef\u4ee5\u9009\u62e9\u4fee\u6539\u767b\u5f55\u5bc6\u7801<\/p>\n<p>ALTER USER &#039;root&#039;&#064;&#039;localhost&#039; IDENTIFIED BY &#039;new_password&#039;; <\/p>\n<p>\u5c06new_password\u66ff\u6362\u4e3a\u4f60\u81ea\u5df1\u7684\u5bc6\u7801\u5c31\u884c\u4e86&#xff0c;\u4f46\u662f\u6709\u4e00\u5b9a\u8981\u6c42&#xff0c;\u9700\u8981\u5305\u542b\u5927\u5c0f\u5199\u5b57\u6bcd&#xff0c;\u6570\u5b57\u7b49<\/p>\n<p>\u5728mysql\u547d\u4ee4\u884c\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93&#xff0c;\u81ea\u5df1\u53ef\u4ee5\u66f4\u6362\u547d\u540d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"266\" src=\"2025-04-18fe3lxwn0pdi.png\" width=\"756\" \/><\/p>\n<p>\u521b\u5efa\u597d\u540e\u4f7f\u7528\u8be5\u6570\u636e\u5e93<\/p>\n<p>use IOTtest <\/p>\n<p>\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u8868\u683c\u8bb0\u5f55\u8bbe\u5907\u7684\u6570\u636e&#xff0c;\u7b80\u5355\u8d77\u89c1\u8fd9\u91cc\u521b\u5efa\u4e00\u4e2a\u5e26\u6709device_id\u548clocation\u7684\u8868\u683c<\/p>\n<p>CREATE TABLE devices (<br \/>\ndevice_id INT AUTO_INCREMENT PRIMARY KEY,<br \/>\nlocation VARCHAR(255) NOT NULL<br \/>\n); <\/p>\n<p>\u7136\u540eshow\u4e00\u4e0b\u770b\u770b\u662f\u5426\u521b\u5efa\u6210\u529f&#xff0c;\u6211\u8fd9\u91cc\u521b\u5efa\u7684\u8868\u683c\u540d\u79f0\u4e3adevices<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"312\" src=\"2025-04-18ojr5an1k4fc.png\" width=\"785\" \/><\/p>\n<p>\u521b\u5efa\u6210\u529f&#xff0c;\u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u5c06windows\u7aef\u7684navicat\u8fde\u63a5\u5230\u8be5\u6570\u636e\u5e93&#xff0c;\u8fd9\u6837\u65b9\u4fbf\u67e5\u770b\u6570\u636e\u3001\u7f16\u8f91\u6570\u636e\u548c\u914d\u7f6e&#xff0c;\u4e4b\u524d\u6211\u4eec\u5728centos\u672c\u5730\u914d\u7f6e\u8fc7\u767b\u5f55MySQL\u7684\u5bc6\u7801&#xff0c;\u73b0\u5728\u9700\u8981\u8bbe\u7f6e\u8fdc\u7a0b\u8fde\u63a5\u7684\u8d26\u53f7\u548c\u5bc6\u7801&#xff0c;\u8fd9\u4e24\u4e2a\u7c7b\u4f3c&#xff0c;\u65b9\u4fbf\u8d77\u89c1\u6211\u8bbe\u7f6e\u4e86\u6240\u4ee5IP\u8f93\u5165\u6b63\u786e\u7684\u5bc6\u7801\u90fd\u53ef\u4ee5\u8fde\u63a5\u8be5\u6570\u636e\u5e93&#xff0c;\u6b63\u5e38\u662f\u9700\u8981\u8bbe\u7f6eIP\u6765\u4fdd\u8bc1\u5b89\u5168\u6027<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"131\" src=\"2025-04-18rdmnxu5fvsf.png\" width=\"824\" \/><\/p>\n<p>\u8f93\u5165\u8fd9\u4e24\u6761\u6307\u4ee4\u8bbe\u7f6e\u8bbf\u95ee\u6743\u9650<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"410\" src=\"2025-04-184wmoxr2udb3.png\" width=\"989\" \/><\/p>\n<p>\u4e24\u6761\u6307\u4ee4\u7684\u89e3\u91ca\u5982\u4e0a<\/p>\n<p>\u6700\u540e\u8fdb\u884c\u5237\u65b0\u7136\u540e\u9000\u51fa\u6570\u636e\u5e93\u547d\u4ee4\u884c<\/p>\n<p>FLUSH PRIVILEGES;<br \/>\nEXIT; <\/p>\n<p>\u914d\u7f6e\u9632\u706b\u5899&#xff0c;\u5f00\u653e\u7aef\u53e33306<\/p>\n<p>sudo firewall-cmd &#8211;permanent &#8211;add-port&#061;3306\/tcp<br \/>\nsudo firewall-cmd &#8211;reload <\/p>\n<p>\u63a5\u4e0b\u6765\u6253\u5f00navicat\u8fdb\u884c\u8fde\u63a5&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"152\" src=\"2025-04-184af4lbwjhmm.png\" width=\"470\" \/><\/p>\n<p>\u70b9\u51fb\u8fde\u63a5<\/p>\n<p>\u9009\u62e9MySQL<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"906\" src=\"2025-04-182gociutbajn.png\" width=\"950\" \/><\/p>\n<p>\u8f93\u5165\u4fe1\u606f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1079\" src=\"2025-04-18gfvytlo3so3.png\" width=\"1337\" \/><\/p>\n<p>\u8fde\u63a5\u540d\u79f0\u81ea\u5b9a\u4e49&#xff0c;\u4e3b\u673a\u4e3a\u670d\u52a1\u5668\u7684IP&#xff0c;\u7528\u6237\u540d\u53ca\u5bc6\u7801\u5c31\u662f\u521a\u521a\u5728\u670d\u52a1\u5668\u8bbe\u7f6e\u7684\u7528\u6237\u540d\u4e0e\u5bc6\u7801<\/p>\n<p>\u7136\u540e\u8fde\u63a5\u540e\u67e5\u770b\u5230\u6211\u4eec\u521a\u521a\u65b0\u5efa\u7684\u8868<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"412\" src=\"2025-04-182u0t3puvvif.png\" width=\"925\" \/>\u8bf4\u660e\u5df2\u7ecf\u8fde\u63a5\u6210\u529f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u66f4\u65b0\u540e\u518d\u4e0b\u8f7d\u4f1a\u53d1\u73b0\u63d0\u793aGPG key\u9519\u8bef\uff0c\u8fd9\u91cc\u53ef\u4ee5\u5173\u95edgpgcheck\uff0c\u5728\u521a\u521a\u7684repo\u6587\u4ef6\u4fee\u6539\uff1a\u5c06repo\u6587\u4ef6\u4e2d\u6bcf\u4e2agpgcheck\u6539\u4e3a0\u5728\u8fd9\u4e2a\u7f51\u9875\u4e0b\u8f7d\u670d\u52a1\u5668\u6ce8\u610fInstall the dependencies\u65f6\u8981\u52a0sudo\u7ed9\u6743\u9650\u5f00\u542femqx\u670d\u52a1\u5668\u540e\u53ef\u4ee5\u6253\u5f00emqx\u7684dashboard\uff0c\u5728\u7f51\u9875\u641c\u7d22http:\/\/{\u81ea\u5df1\u7684ip}:18083\u5c31\u53ef\u4ee5\u6253\u5f00\u9996\u6b21\u767b\u5f55\u7684\u8d26\u53f7\u662fadmin\uff0c\u5bc6\u7801\u662fpublic\uff0c\u8fdb\u53bb\u540e\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539\u5bc6\u7801\u3002_emqx mysql<\/p>\n","protected":false},"author":2,"featured_media":13696,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[114,833,43,44],"topic":[],"class_list":["post-13716","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-mysql","tag-833","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7269\u8054\u7f51\u5165\u95e8-\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/13716.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7269\u8054\u7f51\u5165\u95e8-\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u66f4\u65b0\u540e\u518d\u4e0b\u8f7d\u4f1a\u53d1\u73b0\u63d0\u793aGPG key\u9519\u8bef\uff0c\u8fd9\u91cc\u53ef\u4ee5\u5173\u95edgpgcheck\uff0c\u5728\u521a\u521a\u7684repo\u6587\u4ef6\u4fee\u6539\uff1a\u5c06repo\u6587\u4ef6\u4e2d\u6bcf\u4e2agpgcheck\u6539\u4e3a0\u5728\u8fd9\u4e2a\u7f51\u9875\u4e0b\u8f7d\u670d\u52a1\u5668\u6ce8\u610fInstall the dependencies\u65f6\u8981\u52a0sudo\u7ed9\u6743\u9650\u5f00\u542femqx\u670d\u52a1\u5668\u540e\u53ef\u4ee5\u6253\u5f00emqx\u7684dashboard\uff0c\u5728\u7f51\u9875\u641c\u7d22http:\/\/{\u81ea\u5df1\u7684ip}:18083\u5c31\u53ef\u4ee5\u6253\u5f00\u9996\u6b21\u767b\u5f55\u7684\u8d26\u53f7\u662fadmin\uff0c\u5bc6\u7801\u662fpublic\uff0c\u8fdb\u53bb\u540e\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539\u5bc6\u7801\u3002_emqx mysql\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/13716.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T12:38:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123815-680247b785b20.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/13716.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/13716.html\",\"name\":\"\u7269\u8054\u7f51\u5165\u95e8-\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T12:38:23+00:00\",\"dateModified\":\"2025-04-18T12:38:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/13716.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/13716.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/13716.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7269\u8054\u7f51\u5165\u95e8----\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7269\u8054\u7f51\u5165\u95e8-\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/13716.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7269\u8054\u7f51\u5165\u95e8-\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u66f4\u65b0\u540e\u518d\u4e0b\u8f7d\u4f1a\u53d1\u73b0\u63d0\u793aGPG key\u9519\u8bef\uff0c\u8fd9\u91cc\u53ef\u4ee5\u5173\u95edgpgcheck\uff0c\u5728\u521a\u521a\u7684repo\u6587\u4ef6\u4fee\u6539\uff1a\u5c06repo\u6587\u4ef6\u4e2d\u6bcf\u4e2agpgcheck\u6539\u4e3a0\u5728\u8fd9\u4e2a\u7f51\u9875\u4e0b\u8f7d\u670d\u52a1\u5668\u6ce8\u610fInstall the dependencies\u65f6\u8981\u52a0sudo\u7ed9\u6743\u9650\u5f00\u542femqx\u670d\u52a1\u5668\u540e\u53ef\u4ee5\u6253\u5f00emqx\u7684dashboard\uff0c\u5728\u7f51\u9875\u641c\u7d22http:\/\/{\u81ea\u5df1\u7684ip}:18083\u5c31\u53ef\u4ee5\u6253\u5f00\u9996\u6b21\u767b\u5f55\u7684\u8d26\u53f7\u662fadmin\uff0c\u5bc6\u7801\u662fpublic\uff0c\u8fdb\u53bb\u540e\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539\u5bc6\u7801\u3002_emqx mysql","og_url":"https:\/\/www.wsisp.com\/helps\/13716.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T12:38:23+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418123815-680247b785b20.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/13716.html","url":"https:\/\/www.wsisp.com\/helps\/13716.html","name":"\u7269\u8054\u7f51\u5165\u95e8-\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T12:38:23+00:00","dateModified":"2025-04-18T12:38:23+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/13716.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/13716.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/13716.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7269\u8054\u7f51\u5165\u95e8----\u4e0b\u8f7dEMQX\u670d\u52a1\u5668\u4e0eMysql"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/13716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=13716"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/13716\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/13696"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=13716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=13716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=13716"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=13716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}