{"id":28536,"date":"2023-05-27T23:52:04","date_gmt":"2023-06-13T19:17:30","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/"},"modified":"2025-08-12T08:43:08","modified_gmt":"2025-08-12T00:43:08","slug":"%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/","title":{"rendered":"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09"},"content":{"rendered":"<p>\u4e3a\u4e86\u5efa\u7acb\u8fd9\u6837\u7684\u670d\u52a1\u5668\uff0c\u5b89\u88c5MariaDB\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">OS: Ubuntu 18.04 LTS \/ Ubuntu 20.04 LTS \/ Ubuntu 22.04 LTS<\/ul>\n<\/li>\n<\/ul>\n<p>\u304a\u3088\u3073 Raspberry Pi OS Lite Release date: April 4th 2022.04<\/p>\n<p>\u540c\u3058\u30de\u30b7\u30f3\u306b DB \u30b5\u30fc\u30d0\u3068Web\u30a2\u30d7\u30ea\u30b5\u30fc\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001<br \/>\nWeb\u30a2\u30d7\u30ea\u304b\u3089\u306f DB \u3078 localhost \u3067\u63a5\u7d9a<br \/>\nDB \u306b\u306f\u65e5\u672c\u8a9e\u30c6\u30fc\u30d6\u30eb\u540d\u3001\u65e5\u672c\u8a9e\u30ab\u30e9\u30e0\u540d\u3092\u7528\u3044\u308b\u3002<\/p>\n<p>\u7b80\u5355\u7684\u5b89\u88c5\u6b65\u9aa4\u3002<br \/>\n\uff082020\/06\/10\uff1a\u786e\u8ba4\u5728Ubuntu20.04LTS\u4e0a\u540c\u6837\u6709\u6548\uff0c\u5e76\u66f4\u6539\u6807\u9898\u548c\u5f00\u5934\uff09<br \/>\n\uff082020\/12\/18\uff1a\u6dfb\u52a0\u5173\u4e8e\u91cd\u65b0\u5b89\u88c5\u7684\u5185\u5bb9\uff09<br \/>\n\uff082021\/03\/25\uff1a\u9488\u5bf9\u5728Ubuntu20.04LTS\u4e0a\u4f7f\u7528CREATE TABLE\u65f6\u51fa\u73b0\u9519\u8bef\u8fdb\u884c\u4e86\u4fee\u6539\u548c\u8865\u5145\uff09<br \/>\n\uff082022\/06\/06\uff1a\u786e\u8ba4\u5728Ubuntu22.04LTS\u4e0a\u540c\u6837\u6709\u6548\uff0c\u5e76\u66f4\u6539\u6807\u9898\u548c\u5f00\u5934\uff09<br \/>\n\uff082022\/08\/03\uff1a\u786e\u8ba4\u5728Raspberry Pi OS Lite\u53d1\u5e03\u65e5\u671f\u4e3a2022\u5e744\u67084\u65e5\u7684\u60c5\u51b5\u4e0b\u540c\u6837\u6709\u6548\uff0c\u5e76\u66f4\u6539\u6807\u9898\u7b49\uff09<br \/>\n\uff082022\/08\/10\uff1a\u6dfb\u52a0\u5173\u4e8e\u65f6\u533a\u786e\u8ba4\u7684\u5185\u5bb9\uff09<\/p>\n<h1>\u5b89\u88c5\u76f4\u63a5\u4f7f\u7528Ubuntu \/ Raspberry Pi OS\u5b98\u65b9\u8f6f\u4ef6\u4ed3\u5e93\u4e2d\u7684\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\n$ sudo apt-get install mariadb-server mariadb-client\r\n<\/code><\/pre>\n<h1>\u7248\u672c\u786e\u8ba4<\/p>\n<pre class=\"post-pre\"><code>\r\n$ sudo mysql -v\r\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\r\nYour MariaDB connection id is 42\r\nServer version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04\r\n\r\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\r\n\r\nReading history-file \/home\/nanbuwks\/.mysql_history\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nMariaDB [(none)]&gt; exit;\r\nWriting history-file \/home\/nanbuwks\/.mysql_history\r\nBye\r\n<\/code><\/pre>\n<p>\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0c\u5404\u81ea\u5728\u4e0d\u540c\u7684\u65e5\u5b50\u53bb\u9a8c\u8bc1\u7248\u672c\u7684\u73af\u5883\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Ubuntu20.04 (2020\/06\/10)<\/ul>\n<\/li>\n<\/ul>\n<p>MariaDB Sever version \u306f 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04<\/p>\n<p>Ubuntu22.04 (2022\/06\/06)<\/p>\n<p>MariaDB Sever version \u306f 10.6.7-MariaDB-2ubuntu1 Ubuntu 22.04<\/p>\n<p>Raspberry Pi OS Lite Release date: April 4th 2022.04 (2022\/08\/02)<\/p>\n<p>10.5.15-MariaDB-0+deb11u1 Raspbian 11<\/p>\n<p>\u51e0\u4e4e\u662f\u7b2c\u4e00\u6b21\u4f7f\u7528Mariadb\uff0c\u4f46\u662f\u6211\u6ca1\u60f3\u5230\u53ef\u4ee5\u901a\u8fc7mysql\u5728CLI\u4e2d\u8fdb\u884c\u8c03\u7528\u3002<\/p>\n<h1>\u6587\u5b57\u7f16\u7801\u8bbe\u7f6e\u5c06\/etc\/mysql\/mariadb.conf.d\/50-server.cnf \u66f4\u6539\u5982\u4e0b\uff1a<\/p>\n<pre class=\"post-pre\"><code>\r\n#\r\n# * Character sets\r\n#\r\n# MySQL\/MariaDB default is Latin1, but in Debian we rather default to the full\r\n# utf8 4-byte character set. See also client.cnf\r\n#\r\ncharacter-set-server  = utf8mb4\r\ncollation-server      = utf8mb4_general_ci\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u662f\u7528\u4e2d\u6587\u672c\u5730\u5316\u7684\u53e5\u5b50\u8f6c\u8ff0\uff0c\u4ec5\u63d0\u4f9b\u4e00\u79cd\u9009\u9879\uff1a<br \/>\n\u5411\u4e0b<\/p>\n<pre class=\"post-pre\"><code>\r\n#\r\n# * Character sets\r\n#\r\n# MySQL\/MariaDB default is Latin1, but in Debian we rather default to the full\r\n# utf8 4-byte character set. See also client.cnf\r\n#\r\ncharacter-set-server  = utf8mb4\r\ncollation-server      = utf8mb4_bin\r\n\r\n\r\n<\/code><\/pre>\n<p>\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff0c\u8bbe\u7f6e\u4e3a\u5305\u542b4\u4e2a\u5b57\u8282\u7684UTF8\u7f16\u7801\u3002<\/p>\n<p>\u5728\u5305\u542b4\u4e2a\u5b57\u8282\u7684UTF8\u4ee3\u7801\u4e2d\u8fdb\u884c\u8bbe\u7f6e\u548c\u6bd4\u8f83\uff0c\u533a\u5206\u5927\u5c0f\u5199\u3002<\/p>\n<p>\u6839\u636e @lowln \u4e8e 2022\u5e741\u67088\u65e5\u7684\u6307\u6b63\uff0c\u8fdb\u884c\u4fee\u6b63\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\n sudo systemctl restart mariadb\r\n<\/code><\/pre>\n<p>\u5728\u4e2d\u6587\u4e2d\u4ee5\u4e00\u79cd\u65b9\u5f0f\u8fdb\u884c\u91cd\u8ff0\uff1a<\/p>\n<p>\u5728\u4e2d\u6587\u4e2d\u8fdb\u884c\u53cd\u6620\u3002<\/p>\n<h1>\u8bbe\u5b9a<br \/>\n\u5bf9\u4e8eUbuntu\u800c\u8a00\uff0c\u5982\u679c\u4f60\u60f3\u8981\u9996\u5148\u4f7f\u7528\u666e\u901a\u7528\u6237\u8fdb\u884c\u8bbe\u7f6e\u7684\u8bdd&#8230;<\/p>\n<pre class=\"post-pre\"><code>\r\n$ mysql_secure_installation \r\n\r\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\r\n      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\r\n\r\nIn order to log into MariaDB to secure it, we'll need the current\r\npassword for the root user.  If you've just installed MariaDB, and\r\nyou haven't set the root password yet, the password will be blank,\r\nso you should just press enter here.\r\n\r\nEnter current password for root (enter for none): \r\nERROR 1698 (28000): Access denied for user 'root'@'localhost'\r\nAborting!\r\n\r\nCleaning up...\r\n\r\n<\/code><\/pre>\n<p>\u5728\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u5c3d\u7ba1\u6ca1\u6709\u7ec8\u6b62\uff0c\u4f46\u51fa\u73b0\u4e86\u8bbf\u95ee\u88ab\u62d2\u7edd\u7684\u60c5\u51b5\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\n$ sudo mysql_secure_installation \r\n<\/code><\/pre>\n<p>\u6211\u4f7f\u7528sudo\u8fd0\u884c\u6210\u529f\u3002<br \/>\n\u4e0b\u9762\u662fUbuntu\u7684\u60c5\u51b5\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\n\r\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\r\n      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\r\n\r\nIn order to log into MariaDB to secure it, we'll need the current\r\npassword for the root user.  If you've just installed MariaDB, and\r\nyou haven't set the root password yet, the password will be blank,\r\nso you should just press enter here.\r\n\r\nEnter current password for root (enter for none): \r\nOK, successfully used password, moving on...\r\n\r\nSetting the root password ensures that nobody can log into the MariaDB\r\nroot user without the proper authorisation.\r\n\r\nSet root password? [Y\/n] Y\r\nNew password: \r\nRe-enter new password: \r\nSorry, passwords do not match.\r\n\r\nNew password: \r\nRe-enter new password: \r\nPassword updated successfully!\r\nReloading privilege tables..\r\n ... Success!\r\n\r\n\r\nBy default, a MariaDB installation has an anonymous user, allowing anyone\r\nto log into MariaDB without having to have a user account created for\r\nthem.  This is intended only for testing, and to make the installation\r\ngo a bit smoother.  You should remove them before moving into a\r\nproduction environment.\r\n\r\nRemove anonymous users? [Y\/n] Y\r\n ... Success!\r\n\r\nNormally, root should only be allowed to connect from 'localhost'.  This\r\nensures that someone cannot guess at the root password from the network.\r\n\r\nDisallow root login remotely? [Y\/n] Y\r\n ... Success!\r\n\r\nBy default, MariaDB comes with a database named 'test' that anyone can\r\naccess.  This is also intended only for testing, and should be removed\r\nbefore moving into a production environment.\r\n\r\nRemove test database and access to it? [Y\/n] Y\r\n - Dropping test database...\r\n ... Success!\r\n - Removing privileges on test database...\r\n ... Success!\r\n\r\nReloading the privilege tables will ensure that all changes made so far\r\nwill take effect immediately.\r\n\r\nReload privilege tables now? [Y\/n] Y\r\n ... Success!\r\n\r\nCleaning up...\r\n\r\nAll done!  If you've completed all of the above steps, your MariaDB\r\ninstallation should now be secure.\r\n\r\nThanks for using MariaDB!\r\n\r\n<\/code><\/pre>\n<p>\u7981\u6b62\u8fdc\u7a0b\u6839\u767b\u5f55\uff1f[\u662f\/\u5426] \u662f<\/p>\n<p>\u5982\u679c\u662f\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\u7684\u60c5\u51b5\u4e0b\uff1a<\/p>\n<pre class=\"post-pre\"><code>\r\n\r\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\r\n      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\r\n\r\nIn order to log into MariaDB to secure it, we'll need the current\r\npassword for the root user. If you've just installed MariaDB, and\r\nhaven't set the root password yet, you should just press enter here.\r\n\r\nEnter current password for root (enter for none): \r\nOK, successfully used password, moving on...\r\n\r\nSetting the root password or using the unix_socket ensures that nobody\r\ncan log into the MariaDB root user without the proper authorisation.\r\n\r\nYou already have your root account protected, so you can safely answer 'n'.\r\n\r\nSwitch to unix_socket authentication [Y\/n] n\r\n ... skipping.\r\n\r\nYou already have your root account protected, so you can safely answer 'n'.\r\n\r\nChange the root password? [Y\/n] y\r\nNew password: \r\nRe-enter new password: \r\nPassword updated successfully!\r\nReloading privilege tables..\r\n ... Success!\r\n\r\n\r\nBy default, a MariaDB installation has an anonymous user, allowing anyone\r\nto log into MariaDB without having to have a user account created for\r\nthem.  This is intended only for testing, and to make the installation\r\ngo a bit smoother.  You should remove them before moving into a\r\nproduction environment.\r\n\r\nRemove anonymous users? [Y\/n] Y\r\n ... Success!\r\n\r\nNormally, root should only be allowed to connect from 'localhost'.  This\r\nensures that someone cannot guess at the root password from the network.\r\n\r\nDisallow root login remotely? [Y\/n] Y\r\n ... Success!\r\n\r\nBy default, MariaDB comes with a database named 'test' that anyone can\r\naccess.  This is also intended only for testing, and should be removed\r\nbefore moving into a production environment.\r\n\r\nRemove test database and access to it? [Y\/n] Y\r\n - Dropping test database...\r\n ... Success!\r\n - Removing privileges on test database...\r\n ... Success!\r\n\r\nReloading the privilege tables will ensure that all changes made so far\r\nwill take effect immediately.\r\n\r\nReload privilege tables now? [Y\/n] Y\r\n ... Success!\r\n\r\nCleaning up...\r\n\r\nAll done!  If you've completed all of the above steps, your MariaDB\r\ninstallation should now be secure.\r\n\r\nThanks for using MariaDB!\r\n\r\n<\/code><\/pre>\n<h1>\u521b\u5efa\u7528\u4e8eWeb\u5e94\u7528\u7a0b\u5e8f\u7684\u7528\u6237\u548c\u6d4b\u8bd5\u6570\u636e\u5e93\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\n$ sudo mysql -u root -p\r\n<\/code><\/pre>\n<p>\u6211\u5c1d\u8bd5\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u6570\u636e\u5e93\u3002\u4e3a\u4e86\u8bd5\u8bd5\uff0c\u5728\u6570\u636e\u5e93\u540d\u4e0a\u4e5f\u7528\u4e86\u65e5\u8bed\u3002<\/p>\n<pre class=\"post-pre\"><code>MariaDB [(none)]&gt; create database \u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9;\r\nQuery OK, 1 row affected (0.00 sec)\r\n<\/code><\/pre>\n<p>\u521b\u5efa\u7528\u4e8e\u4eceWeb\u5e94\u7528\u7a0b\u5e8f\u8fdb\u884c\u8fde\u63a5\u7684\u7528\u6237<\/p>\n<pre class=\"post-pre\"><code>MariaDB [(none)]&gt;  CREATE USER 'webdb'@'localhost' IDENTIFIED BY 'password';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n<\/code><\/pre>\n<p>\uff08&#8221;\u5bc6\u7801&#8221; \u5e94\u9002\u65f6\u66f4\u6539\uff09<\/p>\n<p>\u8a2d\u5b9a\u6b0a\u9650<\/p>\n<pre class=\"post-pre\"><code>MariaDB [(none)]&gt; GRANT ALL ON \u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9.* TO 'webdb'@'localhost';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nMariaDB [(none)]&gt; exit;\r\nBye\r\n<\/code><\/pre>\n<p>\u5c1d\u8bd5\u8fde\u63a5<\/p>\n<pre class=\"post-pre\"><code>\r\n$ mysql -u webdb -h localhost -p\r\nEnter password: \r\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\r\nYour MariaDB connection id is 44\r\nServer version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04\r\n\r\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nMariaDB [(none)]&gt; use \u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\r\nDatabase changed\r\nMariaDB [\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9]&gt; show tables;\r\nEmpty set (0.00 sec)\r\n<\/code><\/pre>\n<p>\u987a\u5229\u8fdb\u884c<\/p>\n<p>\u5982\u679c\u8981\u4ece\u4efb\u4f55\u7f51\u7edc\u8bbf\u95ee(root\u6743\u9650\u4e0b)\u521b\u5efa\u53e6\u4e00\u4e2awebdb\u7528\u6237\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\nMariaDB [(none)]&gt; CREATE USER 'webdb'@'%' IDENTIFIED BY 'password';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nMariaDB [(none)]&gt; GRANT ALL ON \u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9.* TO webdb@'%';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n<\/code><\/pre>\n<h1>\u8bf7\u786e\u8ba4\u7528\u6237\u8bbe\u7f6e\u7528\u6237\u53ef\u4ee5\u8bbe\u7f6e\u4e3b\u673a\u5417\uff1f<\/p>\n<pre class=\"post-pre\"><code>\r\nMariaDB [(none)]&gt; select user, host from mysql.user;\r\n+----------+-----------+\r\n| user     | host      |\r\n+----------+-----------+\r\n| webdb    | %         |\r\n| root     | localhost |\r\n| testUser | localhost |\r\n| webdb    | localhost |\r\n+----------+-----------+\r\n4 rows in set (0.00 sec)\r\n<\/code><\/pre>\n<p>\u6570\u636e\u5e93\u6743\u9650\u662f\u5426\u5df2\u7ecf\u5206\u914d\u4e86\uff1f<\/p>\n<pre class=\"post-pre\"><code>MariaDB [(none)]&gt; show grants for 'webdb'@'localhost'\r\n+--------------------------------------------------------------------------------------------------------------+\r\n| Grants for webdb@localhost                                                                                   |\r\n+--------------------------------------------------------------------------------------------------------------+\r\n| GRANT USAGE ON *.* TO 'webdb'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' |\r\n| GRANT ALL PRIVILEGES ON `\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9`.* TO 'webdb'@'localhost'                                        |\r\n+--------------------------------------------------------------------------------------------------------------+\r\n2 rows in set (0.00 sec)\r\n\r\nMariaDB [(none)]&gt; show grants for `webdb`@'%';\r\n+------------------------------------------------------------------------------------------------------+\r\n| Grants for webdb@%                                                                                   |\r\n+------------------------------------------------------------------------------------------------------+\r\n| GRANT USAGE ON *.* TO 'webdb'@'%' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' |\r\n| GRANT ALL PRIVILEGES ON `\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9`.* TO 'webdb'@'%'                                        |\r\n+------------------------------------------------------------------------------------------------------+\r\n2 rows in set (0.00 sec)\r\n\r\n\r\n\r\n<\/code><\/pre>\n<h1>\u5141\u8bb8\u5916\u90e8\u8fde\u63a5\u7684\u8bbe\u7f6e<\/p>\n<pre class=\"post-pre\"><code>\r\n$ sudo vim \/etc\/mysql\/mariadb.conf.d\/50-server.cnf \r\n<\/code><\/pre>\n<p>\u4f5c\u4e3a<\/p>\n<pre class=\"post-pre\"><code>\r\n\u30fb\u30fb\u30fb \r\n# Instead of skip-networking the default is now to listen only on\r\n# localhost which is more compatible and is not less secure.\r\nbind-address            = 127.0.0.1\r\n\u30fb\u30fb\u30fb\r\n<\/code><\/pre>\n<p>\u2193\u6539\u53d8<\/p>\n<pre class=\"post-pre\"><code>\r\n\u30fb\u30fb\u30fb \r\n# Instead of skip-networking the default is now to listen only on\r\n# localhost which is more compatible and is not less secure.\r\n#bind-address           = 127.0.0.1\r\nbind-address            = 0.0.0.0\r\n\u30fb\u30fb\u30fb\r\n<\/code><\/pre>\n<p>\u91cd\u65b0\u542f\u52a8MariaDB<\/p>\n<pre class=\"post-pre\"><code>\r\n$ sudo service mariadb restart\r\n\r\n<\/code><\/pre>\n<p>\u6ca1\u95ee\u9898\u3002<\/p>\n<h1>\u4e0d\u9700\u8981\u4f7f\u7528sudo\uff0c\u53ef\u4ee5\u4ee5root\u7528\u6237\u8bbf\u95ee\u3002<br \/>\n\u5982\u679c\u4e0d\u5f97\u4e0d\u8fdb\u884c\u6b64\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u65b9\u5f0f\u8fdb\u884c\u3002<\/p>\n<p>\u9996\u5148\uff0c\u5bf9\u5f53\u524d\u8bbe\u7f6e\u8fdb\u884c\u786e\u8ba4\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; SHOW GRANTS FOR root@localhost;\r\n+--------------------------------------------------------------------------------------------------------------------------------------------------+\r\n| Grants for root@localhost                                                                                                                        |\r\n+--------------------------------------------------------------------------------------------------------------------------------------------------+\r\n| GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED VIA unix_socket USING '*45BD13A4098870D220D0D524550A3E6F3E698C5A' WITH GRANT OPTION |\r\n| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION                                                                                    |\r\n+--------------------------------------------------------------------------------------------------------------------------------------------------+\r\n2 rows in set (0.000 sec)\r\n<\/code><\/pre>\n<p>\u4fee\u6539\u8bbe\u5b9a<\/p>\n<pre class=\"post-pre\"><code>&gt; grant all privileges on *.* to root@localhost identified by 'password' with grant option;\r\nQuery OK, 0 rows affected (0.022 sec)\r\n&gt; flush privileges;\r\nQuery OK, 0 rows affected (0.093 sec)\r\n<\/code><\/pre>\n<p>\u4fee\u6539\u540e\u7684\u8bbe\u7f6e\u662f\u8fd9\u6837\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; SHOW GRANTS FOR root@localhost;\r\n+----------------------------------------------------------------------------------------------------------------------------------------+\r\n| Grants for root@localhost                                                                                                              |\r\n+----------------------------------------------------------------------------------------------------------------------------------------+\r\n| GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' WITH GRANT OPTION |\r\n| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION                                                                          |\r\n+----------------------------------------------------------------------------------------------------------------------------------------+\r\n2 rows in set (0.000 sec)\r\n\r\n<\/code><\/pre>\n<h1>\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u8868\u5e76\u8fdb\u884c\u64cd\u4f5c\u786e\u8ba4\u3002\u521b\u5efa\u540d\u4e3a\u300csensor\u300d\u7684\u8868\u3002<br \/>\n\u4e3a\u4e86\u6d4b\u8bd5\uff0c\u6211\u4e5f\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a\u300c\u30bb\u30f3\u30b5\u300d\u7684\u8868\uff0c\u770b\u770b\u662f\u5426\u652f\u6301\u65e5\u8bed\u3002<\/p>\n<pre class=\"post-pre\"><code>create table if not exists sensor (\r\nid SERIAL PRIMARY KEY AUTO_INCREMENT NOT NULL,\r\nsensor integer,\r\n temp real,\r\n hemi real,\r\n memo text\r\n);\r\n\r\ncreate table if not exists \u30bb\u30f3\u30b5 (\r\nid SERIAL PRIMARY KEY AUTO_INCREMENT NOT NULL,\r\n\u30bb\u30f3\u30b5 integer,\r\n \u6e29\u5ea6 real,\r\n \u6e7f\u5ea6 real,\r\n \u30e1\u30e2 text\r\n);\r\n<\/code><\/pre>\n<p>\uff082021\u5e7403\u670825\u65e5\u8a18\u30012022\u5e7408\u670803\u65e5\u4fee\u6b63\uff1a\uff09<br \/>\n\u5982\u679c\u60a8\u4f7f\u7528Ubuntu 20.04\uff08MariaDB\u7248\u672c\u4e3a10.3.25-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04\uff09\u6216\u66f4\u9ad8\u7248\u672c\uff0c\u4ee5\u4e0a\u9519\u8bef\u5c06\u4f1a\u53d1\u751f\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\nMariaDB [\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9]&gt; create table if not exists \u30bb\u30f3\u30b5 ( id SERIAL PRIMARY KEY AUTO_INCREMENT NOT NULL, \u30bb\u30f3\u30b5 integer,  \u6e29\u5ea6 real,  \u6e7f\u5ea6 real,  \u30e1\u30e2 text );\r\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AUTO_INCREMENT NOT NULL, \u30bb\u30f3\u30b5 integer,  \u6e29\u5ea6 real,  \u6e7f\u5ea6 real,  \u30e1...' at line 1\r\nMariaDB [\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9]&gt; \r\n\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>\r\nid SERIAL PRIMARY KEY AUTO_INCREMENT NOT NULL,\r\n<\/code><\/pre>\n<p>\u542c\u8bf4\u5982\u679c\u540c\u65f6\u6307\u5b9a SERIAL \u7c7b\u578b\u548c AUTO_INCREMENT\uff0c\u4f1a\u5bfc\u81f4\u9519\u8bef\u3002<\/p>\n<p>\u300cMySQL :: MySQL 8.0 \u53c2\u8003\u624b\u518c :: 11.1.1 \u6570\u503c\u6570\u636e\u7c7b\u578b\u8bed\u6cd5\u300d<br \/>\nhttps:\/\/dev.mysql.com\/doc\/refman\/8.0\/zh-CN\/numeric-type-syntax.html<\/p>\n<p>\u6839\u636e\u62a5\u9053\uff0c<\/p>\n<blockquote><p>SERIAL \u662f BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE \u7684\u522b\u540d\u3002<br \/>\n\u5728\u6574\u6570\u5217\u7684\u5b9a\u4e49\u4e2d\uff0cSERIAL DEFAULT VALUE \u662f NOT NULL AUTO_INCREMENT UNIQUE \u7684\u522b\u540d\u3002<\/p><\/blockquote>\n<p>\u5c31\u662f\u8fd9\u6837\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5982\u679c\u6539\u6210\u4ee5\u4e0b\u7684\u65b9\u5f0f\uff0c\u5c31\u53ef\u4ee5\u6210\u529f\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code> \r\nMariaDB [\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9]&gt; create table if not exists \u30bb\u30f3\u30b5 ( id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL, \u30bb\u30f3\u30b5 integer,  \u6e29\u5ea6 real,  \u6e7f\u5ea6 real,  \u30e1\u30e2 text );\r\nQuery OK, 0 rows affected (0.017 sec)\r\n\r\n\r\n<\/code><\/pre>\n<p>\uff08\uff1a\u8ffd\u52a0\u8bb0\u4e4b\u7ed3\u675f\uff09<\/p>\n<p>\u6211\u8bd5\u8bd5\u653e\u5165\u6d4b\u8bd5\u6570\u636e\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\nMariaDB [test]&gt; INSERT INTO sensor ( sensor,temp,hemi,memo ) VALUES (1,22.0,85.0,'\u30b9\u30c8\u30fc\u30d6ON');\r\nQuery OK, 1 row affected (0.00 sec)\r\n\r\nMariaDB [test]&gt;  INSERT INTO \u30bb\u30f3\u30b5 ( \u30bb\u30f3\u30b5,\u6e29\u5ea6,\u6e7f\u5ea6,\u30e1\u30e2 ) VALUES (1,22.0,85.0,'\u30b9\u30c8\u30fc\u30d6ON');\r\nQuery OK, 1 row affected (0.00 sec)\r\n\r\n<\/code><\/pre>\n<p>\u786e\u8ba4<\/p>\n<pre class=\"post-pre\"><code>\r\nMariaDB [test]&gt; select * from sensor;\r\n+----+--------+------+------+----------------+\r\n| id | sensor | temp | hemi | memo           |\r\n+----+--------+------+------+----------------+\r\n|  1 |      1 |   22 |   85 | \u30b9\u30c8\u30fc\u30d6ON     |\r\n+----+--------+------+------+----------------+\r\n1 row in set (0.00 sec)\r\n\r\nMariaDB [test]&gt; select * from \u30bb\u30f3\u30b5;\r\n+----+-----------+--------+--------+----------------+\r\n| id | \u30bb\u30f3\u30b5    | \u6e29\u5ea6   | \u6e7f\u5ea6   | \u30e1\u30e2           |\r\n+----+-----------+--------+--------+----------------+\r\n|  1 |         1 |     22 |     85 | \u30b9\u30c8\u30fc\u30d6ON     |\r\n+----+-----------+--------+--------+----------------+\r\n1 row in set (0.01 sec)\r\n\r\n<\/code><\/pre>\n<h1>\u65f6\u533a\u8bbe\u7f6e<\/p>\n<pre class=\"post-pre\"><code>select now();\r\n<\/code><\/pre>\n<p>\u67e5\u770b\u65f6\u95f4\u3002<\/p>\n<p>\u8bf7\u53c2\u8003\u4ee5\u4e0b\u7f51\u5740\u4e86\u89e3\u6709\u5173MySQL 8.0\u7248\u7684\u65f6\u533a\u652f\u6301\u3002<\/p>\n<blockquote><p>\u7cfb\u7edf\u65f6\u533a\u3002\u670d\u52a1\u5668\u5728\u542f\u52a8\u65f6\u4f1a\u81ea\u52a8\u8bc6\u522b\u4e3b\u673a\u673a\u5668\u7684\u65f6\u533a\uff0c\u5e76\u4f7f\u7528\u5b83\u6765\u8bbe\u7f6esystem_time_zone\u7cfb\u7edf\u53d8\u91cf\u3002\u4e4b\u540e\uff0c\u8fd9\u4e2a\u503c\u5c06\u4e0d\u4f1a\u6539\u53d8\u3002<\/p><\/blockquote>\n<p>\u5982\u679c\u4e3b\u673a\u7684\u65f6\u533a\u672a\u8bbe\u7f6e\uff0c\u5219\u8bbe\u7f6e\u5e76\u91cd\u65b0\u542f\u52a8\u3002<\/p>\n<h1>\u91cd\u65b0\u5b89\u88c5apt\u5305\u7684\u6e05\u9664\u7b49\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u5462\uff1f<br \/>\n\u5728Ubuntu 18.04\u4e2d\uff0c<\/p>\n<pre class=\"post-pre\"><code>\r\n$ sudo apt purge mariadb-server\r\n<\/code><\/pre>\n<p>\u4f3c\u4e4e\u65e0\u8bba\u600e\u4e48\u505a\u90fd\u4e0d\u987a\u5229\u3002<\/p>\n<p>\u5982\u679c\u9047\u5230\u65e0\u6cd5\u6210\u529f\u91cd\u65b0\u5b89\u88c5MariaDB\u7684\u95ee\u9898\uff0c\u8bf7\u53c2\u8003\u8fd9\u7bc7\u540d\u4e3a\u300cUbuntu\u3067MariaDB\u3092\u3046\u307e\u304f\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u306a\u304f\u306a\u3063\u305f\u3068\u304d\u306e\u5bfe\u51e6\u65b9\u6cd5\u300d\u7684\u6587\u7ae0\u3002\u94fe\u63a5\u5728\u8fd9\u91cc\uff1ahttps:\/\/qiita.com\/SUZUKI_Masaya\/items\/c587512643b7d6337538<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4e86\u5efa\u7acb\u8fd9\u6837\u7684\u670d\u52a1\u5668\uff0c\u5b89\u88c5MariaDB\u3002 OS: Ubuntu 18.04 LTS \/ Ubuntu 20. [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-28536","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u7684\u6280\u672f\u6587\u7ae0\" \/>\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.silicloud.com\/zh\/blog\/\u5b89\u88c5mariadb\uff08\u9002\u7528\u4e8eubuntu-18-04-20-04-22-04-lts\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5b89\u88c5mariadb\uff08\u9002\u7528\u4e8eubuntu-18-04-20-04-22-04-lts\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-13T19:17:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T00:43:08+00:00\" \/>\n<meta name=\"author\" content=\"\u6587, \u7fd4\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6587, \u7fd4\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/\",\"name\":\"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-06-13T19:17:30+00:00\",\"dateModified\":\"2025-08-12T00:43:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c\"},\"description\":\"\u5173\u4e8e\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c\",\"name\":\"\u6587, \u7fd4\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g\",\"caption\":\"\u6587, \u7fd4\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/wenxiang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u7684\u6280\u672f\u6587\u7ae0","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.silicloud.com\/zh\/blog\/\u5b89\u88c5mariadb\uff08\u9002\u7528\u4e8eubuntu-18-04-20-04-22-04-lts\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09","og_description":"\u5173\u4e8e\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5b89\u88c5mariadb\uff08\u9002\u7528\u4e8eubuntu-18-04-20-04-22-04-lts\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-13T19:17:30+00:00","article_modified_time":"2025-08-12T00:43:08+00:00","author":"\u6587, \u7fd4","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6587, \u7fd4","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/","name":"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-06-13T19:17:30+00:00","dateModified":"2025-08-12T00:43:08+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c"},"description":"\u5173\u4e8e\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5b89\u88c5MariaDB\uff08\u9002\u7528\u4e8eUbuntu 18.04 \/ 20.04 \/ 22.04 LTS\u548c\u6811\u8393\u6d3e\u64cd\u4f5c\u7cfb\u7edf\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c","name":"\u6587, \u7fd4","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g","caption":"\u6587, \u7fd4"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/wenxiang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mariadb%ef%bc%88%e9%80%82%e7%94%a8%e4%ba%8eubuntu-18-04-20-04-22-04-lts%e5%92%8c%e6%a0%91%e8%8e%93%e6%b4%be%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%89%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=28536"}],"version-history":[{"count":3,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28536\/revisions"}],"predecessor-version":[{"id":111345,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28536\/revisions\/111345"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=28536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=28536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=28536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}