{"id":435,"date":"2022-09-10T13:48:24","date_gmt":"2022-09-10T05:48:24","guid":{"rendered":"https:\/\/www.db2go.net\/?p=435"},"modified":"2022-09-10T13:56:32","modified_gmt":"2022-09-10T05:56:32","slug":"%e5%9c%a8arm%e4%b8%8a%e7%bc%96%e8%af%91%e5%92%8c%e5%ae%89%e8%a3%85mysql5-7","status":"publish","type":"post","link":"https:\/\/www.db2go.net\/?p=435","title":{"rendered":"\u5728arm\u4e0a\u7f16\u8bd1\u548c\u5b89\u88c5MySQL5.7"},"content":{"rendered":"<p>\u56e0\u4e3a\u5728MySQL\u5b98\u65b9\u6ca1\u6709\u63d0\u4f9barm\u67b6\u6784\u4e0b\u76845.7.x\u7684\u7248\u672c\uff0c\u56e0\u6b64\uff0c\u9700\u8981\u81ea\u5df1\u53bb\u7f16\u8bd1\u4e00\u4efd\u3002<\/p>\n<p>\u9996\u5148\u53bb\u5b98\u7f51\u4e0b\u8f7d\u5e26boost\u7684\u6e90\u7801\u5305\uff0c\u5730\u5740\uff1ahttps:\/\/dev.mysql.com\/downloads\/mysql\/<\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.db2go.net\/wp-content\/uploads\/2022\/09\/wp_editor_md_aefc93fd39db56329fc7b51bf207f24d.jpg\"><img decoding=\"async\" src=\"https:\/\/www.db2go.net\/wp-content\/uploads\/2022\/09\/wp_editor_md_aefc93fd39db56329fc7b51bf207f24d.jpg\" alt=\"\" \/><\/a><\/p>\n<p>\u9009\u62e9\u7ea2\u6846\u4e2d\u7684\uff0c\u5982\u679c\u9009\u62e9\u4e0a\u9762\u7684\u53ea\u6709\u6e90\u7801\u8fd8\u8981\u53bb\u5148\u4e0b\u8f7dboost\uff0c\u591a\u6b64\u4e00\u4e3e\u3002<\/p>\n<p>\u7f16\u8bd1\u8fc7\u7a0b\u5f88\u7b80\u5355\uff1a<br \/>\n\uff081\uff09\u5b89\u88c5\u76f8\u5e94\u7684lib\u5e93<\/p>\n<pre><code class=\"line-numbers\">yum install -y gcc gcc-c++ ncurses-devel bison cmake openssl-devel libtirpc-devel libaio-devel\n<\/code><\/pre>\n<p>\uff082\uff09\u8fdb\u5165\u76ee\u5f55\uff0c\u751f\u6210cmake<\/p>\n<pre><code class=\"line-numbers\">cmake . -DCMAKE_INSTALL_PREFIX=\/usr\/local\/mysql \\ #\u5b89\u88c5\u76ee\u5f55\n-DSYSCONFDIR=\/etc \\ #mysql\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u76ee\u5f55\n-DMYSQL_DATADIR=\/u01\/mysql\/data \\ #\u6570\u636e\u6587\u4ef6\u5b58\u653e\u76ee\u5f55\n-DMYSQL_UNIX_ADDR=\/u01\/mysql\/tmp\/mysql.sock \\ #\u94fe\u63a5\u6587\u4ef6\n-DWITH_BOOST=\/root\/mysql_aarch64\/mysql-5.7.38\/boost\/boost_1_59_0 \\ #\u6307\u5b9aboost\u5e93\u7684\u4f4d\u7f6e\n-DDEFAULT_CHARSET=utf8 \\\n-DDEFAULT_COLLATION=utf8_general_ci \\ #\u6307\u5b9a\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6\u6821\u5bf9\u89c4\u5219\n-DDEFAULT_CHARSET=utf8 \\ #\u6307\u5b9a\u9ed8\u8ba4\u5b57\u7b26\u96c6\u7f16\u7801\n-DWITH_EXTRA_CHARSETS=all \\\n-DWITH_INNOBASE_STORAGE_ENGINE=1 \\ #\u5b89\u88c5INNOBASE\u5b58\u50a8\u5f15\u64ce\n-DWITH_FEDERATED_STORAGE_ENGINE=1 \\\n-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \\ #\u5b89\u88c5BLACKHOLE\u5b58\u50a8\u5f15\u64ce\n-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \\\n-DWITH_ARCHIVE_STORAGE_ENGINE=1 \\ #\u5b89\u88c5ARCHIVE\u5b58\u50a8\u5f15\u64ce\n-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \\ #\u5b89\u88c5PERFSCHEMA\u5b58\u50a8\u5f15\u64ce\n-DWITH_ZLIB=bundled \\\n-DWITH_SSL=system \\\n-DENABLED_LOCAL_INFILE=1 \\\n-DWITH_EMBEDDED_SERVER=1 \\\n-DENABLE_DOWNLOADS=1 \\\n-DWITH_SYSTEMD=1 \\ #\u8ba9\u7cfb\u7edf\u53ef\u4ee5\u7ba1\u7406mysql\u6570\u636e\u5e93\n-DWITH_DEBUG=0 \n<\/code><\/pre>\n<p>\u5728\u7f16\u8bd1\u8fc7\u7a0b\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u7f16\u8bd1\u62a5\u9519<\/th>\n<th>\u89e3\u51b3\u65b9\u6cd5<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage<\/td>\n<td>yum install -y make<\/td>\n<\/tr>\n<tr>\n<td>Cannot find appropriate system libraries for WITH_SSL=system.<\/td>\n<td>yum install -y openssl-devel<\/td>\n<\/tr>\n<tr>\n<td>Package \u2018libtirpc\u2018, required by \u2018virtual:world\u2018, not found<\/td>\n<td>yum install -y libtirpc-devel<\/td>\n<\/tr>\n<tr>\n<td>Could not find rpcgen<\/td>\n<td>(1)<code>wget https:\/\/github.com\/thkukuk\/rpcsvc-proto\/releases\/download\/v1.4.1\/rpcsvc-proto-1.4.1.tar.xz<\/code><br \/>(2)<code>xz -d rpcsvc-proto-1.4.1.tar.xz<\/code><br \/>(3)<code>tar -xvf rpcsvc-proto-1.4.1.tar<\/code><br \/>(4)<code>cd rpcsvc-proto-1.4.1<\/code><br \/>(5)<code>.\/configure<\/code><br \/>(6)<code>make &amp;&amp; make install<\/code><\/td>\n<\/tr>\n<tr>\n<td>The C compiler identification is unknown<\/td>\n<td>\u505a\u4e00\u4e2agcc\u7684\u8f6f\u94fe\u63a5:ln -s \/usr\/local\/gcc\/bin\/gcc \/usr\/bin\/cc<\/td>\n<\/tr>\n<tr>\n<td>Please do not build in-source. Out-of source builds are highly<\/td>\n<td>\u5728cmake\u65f6\u5019\u52a0\u5165\u5b57\u6bb5\uff1a-DFORCE_INSOURCE_BUILD=1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\uff083\uff09make &amp;&amp; make install<br \/>\n\uff084\uff09\u5c06\u7f16\u8bd1\u540e\u7684\u6587\u4ef6\u5939\u6253\u5305\u6210tar.gz\uff0c\u5c31\u53ef\u4ee5\u5728\u4efb\u4f55arm\u67b6\u6784\u4e0b\u4f7f\u7528\u4e86\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7f16\u8bd1\u8fc7\u7a0b\uff0c\u5b89\u88c5\u65f6\uff0c\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<br \/>\n\uff081\uff09\u89e3\u538b\u6587\u4ef6\u5939, <code>tar zxf mysql_5.7.38_aarch.tar.gz -C \/usr\/local<\/code><br \/>\n\uff082\uff09\u505a\u4e00\u4e2a\u8f6f\u94fe\u63a5\uff0c<code>ln -s \/usr\/local\/mysql_5.7.38  \/usr\/local\/mysql<\/code><br \/>\n\uff083\uff09\u521b\u5efa\u7528\u6237\u548c\u7ec4<\/p>\n<pre><code class=\"line-numbers\">groupadd mysql\nuseradd -r -g mysql -s \/bin\/false mysql\n<\/code><\/pre>\n<p>\uff084\uff09\u627e\u4e00\u4e2amy.cnf\uff0c\u9700\u8981\u63d0\u524d\u5c06my.cnf\u4e2d\u5bf9\u5e94\u7684\u6570\u636e\u76ee\u5f55\u521b\u5efa\u597d\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"line-numbers\">mkdir -p \/u01\/mysql\/{mysql_data,log,mysql_undolog,mysql_redolog}\nshell&gt; chown -R mysql.mysql \/u01\/mysql\n<\/code><\/pre>\n<p>\uff085\uff09\u505a\u521d\u59cb\u5316\uff1a<\/p>\n<pre><code class=\"line-numbers\">bin\/mysqld --initialize --user=mysql\n<\/code><\/pre>\n<p>\u4e0a\u9762\u7684\u4f1a\u751f\u6210\u4e00\u4e2a\u968f\u673a\u7684\u5bc6\u7801\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770b<\/p>\n<pre><code class=\"line-numbers\">grep 'temporary password' \/u01\/mysql\/data\/error.log\n<\/code><\/pre>\n<p>\u5982\u679c\u4e0d\u60f3\u751f\u6210\u968f\u673a\u7684\u5bc6\u7801\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<pre><code class=\"line-numbers\">bin\/mysqld --initialize --user=mysql --initialize-insecure\n<\/code><\/pre>\n<p>\uff086\uff09\u914d\u7f6e\u670d\u52a1\uff1a<\/p>\n<pre><code class=\"line-numbers\">cp support-files\/mysql.server \/etc\/init.d\/suremysql\nchkconfig --add emysql\nchkconfig --list\n<\/code><\/pre>\n<p>\uff087\uff09\u542f\u52a8\u670d\u52a1\uff1a<code>systemctl start mysql<\/code><br \/>\n\uff088\uff09\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff1a\u5728\/etc\/profile \u4e2d\u52a0\u5165: <code>export PATH=$PATH:\/usr\/local\/mysql\/bin<\/code><\/p>\n<p>\u6700\u540e\uff0c\u5206\u4eab\u4e00\u4e0b5.7.38 arm\u7684\u7248\u672c\uff1a<\/p>\n<pre><code class=\"line-numbers\">\u94fe\u63a5\uff1ahttps:\/\/pan.baidu.com\/s\/17_56UlGEwxf_b_LEJnsGlg \n\u63d0\u53d6\u7801\uff1a9527\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u4e3a\u5728MySQL\u5b98\u65b9\u6ca1\u6709\u63d0\u4f9barm\u67b6\u6784\u4e0b\u76845.7.x\u7684\u7248\u672c\uff0c\u56e0\u6b64\uff0c\u9700\u8981\u81ea\u5df1\u53bb\u7f16\u8bd1\u4e00\u4efd\u3002 \u9996\u5148\u53bb\u5b98\u7f51\u4e0b\u8f7d\u5e26boo&hellip;<\/p>\n <a href=\"https:\/\/www.db2go.net\/?p=435\" title=\"\u5728arm\u4e0a\u7f16\u8bd1\u548c\u5b89\u88c5MySQL5.7\" class=\"entry-more-link\"><span>Read More<\/span> <span class=\"screen-reader-text\">\u5728arm\u4e0a\u7f16\u8bd1\u548c\u5b89\u88c5MySQL5.7<\/span><\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[5],"tags":[],"class_list":["entry","author-suredandan","post-435","post","type-post","status-publish","format-standard","category-mysql"],"views":3400,"_links":{"self":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=435"}],"version-history":[{"count":3,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/435\/revisions"}],"predecessor-version":[{"id":438,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/435\/revisions\/438"}],"wp:attachment":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}