{"id":354,"date":"2022-08-14T23:37:46","date_gmt":"2022-08-14T15:37:46","guid":{"rendered":"https:\/\/blog.sfgz.com.cn\/?p=354"},"modified":"2022-08-14T23:37:46","modified_gmt":"2022-08-14T15:37:46","slug":"centos7-9%e5%ae%89%e8%a3%85sql-server-2019","status":"publish","type":"post","link":"https:\/\/blog.sfgz.com.cn\/index.php\/2022\/08\/14\/centos7-9%e5%ae%89%e8%a3%85sql-server-2019\/","title":{"rendered":"Centos7.9\u5b89\u88c5SQL Server 2019"},"content":{"rendered":"<blockquote>\n<p>\u51c6\u5907\u5de5\u4f5c<br \/>\n\u64cd\u4f5c\u7cfb\u7edf\uff1aCentos7.9 \u5185\u5b58\uff1a4G \u786c\u76d8\uff1a40G CPU\uff1a2U<br \/>\nSQL Server\u7248\u672c\uff1aSQL Server 2019<br \/>\n\u8f6f\u4ef6\u5b89\u88c5\u5305\uff1a<a href=\"https:\/\/packages.microsoft.com\/rhel\/7\/mssql-server-2019\/mssql-server-15.0.4003.23-3.x86_64.rpm\" title=\"\u4e0b\u8f7d\u5730\u5740\">\u4e0b\u8f7d\u5730\u5740<\/a><\/p>\n<\/blockquote>\n<p><strong>\u5173\u95edSELinux<\/strong><\/p>\n<pre><code class=\"language-shell\">sed -i &#039;\/^SELINUX\/s\/enforcing\/disabled\/g&#039; \/etc\/selinux\/config &amp;&amp; setenforce 0<\/code><\/pre>\n<p><strong>\u6dfb\u52a0\u8f6f\u4ef6\u6e90&amp;\u4fdd\u7559\u539f\u6709\u7f51\u7edc\u6e90<\/strong><\/p>\n<pre><code class=\"language-shell\">curl https:\/\/packages.microsoft.com\/config\/rhel\/7\/prod.repo -o \/etc\/yum.repos.d\/msprod.repo<\/code><\/pre>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56\u5305<\/strong><\/p>\n<pre><code class=\"language-shell\">yum -y install mssql-tools unixODBC-devel bzip2 gdb libsss_nss_idmap cyrus-sasl cyrus-sasl-gssapi<\/code><\/pre>\n<p><strong>\u5b89\u88c5SQL Server2019<\/strong><br \/>\n\u4e0b\u8f7d\u6587\u7ae0\u4e0a\u9762\u63d0\u4f9b\u7684SQL Server2019\uff0c\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u5e76\u5b89\u88c5<\/p>\n<pre><code class=\"language-shell\">rpm -ivh mssql-server-15.0.4003.23-3.x86_64.rpm<\/code><\/pre>\n<p>\u8fd0\u884c\u521d\u59cb\u5316\u914d\u5236<\/p>\n<pre><code class=\"language-shell\">\/opt\/mssql\/bin\/mssql-conf setup <\/code><\/pre>\n<pre><code class=\"language-sql\">usermod: no changes\nChoose an edition of SQL Server:\n  1) Evaluation (free, no production use rights, 180-day limit)\n  2) Developer (free, no production use rights)\n  3) Express (free)\n  4) Web (PAID)\n  5) Standard (PAID)\n  6) Enterprise (PAID) - CPU Core utilization restricted to 20 physical\/40 hyperthreaded\n  7) Enterprise Core (PAID) - CPU Core utilization up to Operating System Maximum\n  8) I bought a license through a retail sales channel and have a product key to enter.\n\nDetails about editions can be found at\nhttps:\/\/go.microsoft.com\/fwlink\/?LinkId=2109348&clcid=0x409\n\nUse of PAID editions of this software requires separate licensing through a\nMicrosoft Volume Licensing program.\nBy choosing a PAID edition, you are verifying that you have the appropriate\nnumber of licenses in place to install and run this software.\n\nEnter your edition(1-8): 3      #\u8fd9\u91cc\u9009\u62e9\u4e86Express\u7248\u672c\nThe license terms for this product can be found in\n\/usr\/share\/doc\/mssql-server or downloaded from:\nhttps:\/\/go.microsoft.com\/fwlink\/?LinkId=2104294&clcid=0x409\n\nThe privacy statement can be viewed at:\nhttps:\/\/go.microsoft.com\/fwlink\/?LinkId=853010&clcid=0x409\n\nDo you accept the license terms? [Yes\/No]:Yes   #\u8f93\u5165Yes\u63a5\u53d7\u8bb8\u53ef\u6761\u76ee\n\nEnter the SQL Server system administrator password:         #\u8bbe\u7f6eSA\u7ba1\u7406\u5458\u5bc6\u7801\nConfirm the SQL Server system administrator password: \nConfiguring SQL Server...\n\nThe licensing PID was successfully processed. The new edition is [Express Edition].\nForceFlush is enabled for this instance. \nForceFlush feature is enabled for log durability.\nCreated symlink from \/etc\/systemd\/system\/multi-user.target.wants\/mssql-server.service to \/usr\/lib\/systemd\/system\/mssql-server.service.\nSetup has completed successfully. SQL Server is now starting.<\/code><\/pre>\n<p><strong>\u6dfb\u52a0\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<pre><code class=\"language-sql\">echo &#039;export PATH=$PATH:\/opt\/mssql-tools\/bin&#039; &gt; \/etc\/profile.d\/mssql.sh\nsource !$\nsource \/etc\/profile.d\/mssql.sh<\/code><\/pre>\n<p><strong>\u9632\u706b\u5899\u6dfb\u52a0\u670d\u52a1<\/strong><\/p>\n<pre><code class=\"language-sql\">firewall-cmd --permanent --add-service=mssql \nfirewall-cmd --zone=public --add-port=1433\/tcp --permanent\nfirewall-cmd --reload<\/code><\/pre>\n<p><strong>\u547d\u4ee4\u884c\u5de5\u5177\u8fde\u63a5\u6d4b\u8bd5<\/strong><\/p>\n<pre><code class=\"language-sql\">sqlcmd -S localhost -U sa\nPassword:      #\u8f93\u5165\u5bc6\u7801<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u51c6\u5907\u5de5\u4f5c \u64cd\u4f5c\u7cfb\u7edf\uff1aCentos7.9 \u5185\u5b58\uff1a4G \u786c\u76d8\uff1a40G CPU\uff1a2U  &hellip; <a href=\"https:\/\/blog.sfgz.com.cn\/index.php\/2022\/08\/14\/centos7-9%e5%ae%89%e8%a3%85sql-server-2019\/\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-354","post","type-post","status-publish","format-standard","hentry","category-server"],"_links":{"self":[{"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=354"}],"version-history":[{"count":2,"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":357,"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/354\/revisions\/357"}],"wp:attachment":[{"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.sfgz.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}