arm安装mysql8_CentOS7+ARM下安装mysql8.0.15教程CentOS7系统在安装时就会⾃带mariadb,是mysql的⼀个分⽀。⼀般我们都是在X86的机器上,运⾏mysql,ARM服务器由于⽬前的⽣态不如intel,所以⽤的不⼴泛。但是ARM架构的处理器,在功耗上是⼀个很⼤的天然优势,所以仍有许多⼈在攻坚ARM⽣态。本篇博客就介绍如何在ARM服务器上安装mysql。
1,卸载CentOS ⾃带的mariadb
输⼊以下命令:
[root@master ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.aarch64
[root@master ~]#
可以看到上⾯已经安装了mariadb-libs-5.5.56-2.el7.aarch64
我们要卸载mariadb
输⼊下⾯命令:
rpm -e mariadb-libs-5.5.56-2.el7.aarch64 --nodeps
再次输⼊
[root@master etc]# rpm -qa | grep mariadb
[root@master etc]#
可以看到mariadb已经不见了,这样就已经卸载了mariadb
2,下载ARM相关的 yum repository
选择第⼀个下载。
下载后,把rpm包上传到服务器随便⼀个⽬录下
然后输⼊下⾯的命令:
[root@master ~]# yum install -arch.rpm
安装完成后进⼊以下的⽬录
[root@master ~]# cd /pos.d/
[root@pos.d]# ll
total 64
-rw-r–r--. 1 root root 389 Sep 10 po
-rw-r–r--. 1 root root 1370 Apr 29 po
-rw-r–r--. 1 root root 709 Apr 29 po
-rw-r–r--. 1 root root 246 Apr 29 po
-rw-r–r--. 1 root root 690 Apr 29 po
-
rw-r–r--. 1 root root 1573 Apr 29 po
-rw-r–r--. 1 root root 6411 Apr 29 po
-rw-r–r--. 1 root root 282 Sep 10 po
-rw-r–r--. 1 root root 1050 Oct 3 po
-rw-r–r--. 1 root root 121 Jul 18 po
-rw-r–r-- 1 root root 1864 Mar 12 14:po
-rw-r–r-- 1 root root 1885 Jan 17 18:po
-rw-r–r-- 1 root root 130 Jan 27 02:po
可以看到⾥⾯多了两个源:po和po,有了这两个源,就可以安装mysql了。看⼀下这两个源的内容。
[root@pos.d]# po
[root@pos.d]# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[root@pos.d]# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[root@pos.d]# Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql80-community]
name=MySQL 8.0 Community Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-connectors-community]
name=MySQL Connectors Community
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-tools-community]
name=MySQL Tools Community
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-tools-preview]
name=MySQL Tools Preview
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-cluster-7.5-community]
name=MySQL Cluster 7.5 Community
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-cluster-7.6-community]
name=MySQL Cluster 7.6 Community
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[root@pos.d]# ^C
[root@pos.d]#
查看⾥⾯的内容,可以看到mysql5.7版本是禁⽌使⽤的,这⾥可以使⽤的就是8.0版本你也可以更改⾃⼰想要下载的版本,只需把那⼀项后⾯设置为enabled=1即可
输⼊下⾯命令查看mysql的相关包
[root@master ~]# yum repolist enabled | grep “mysql.-community.”
[root@master ~]# yum repolist enabled | grep “mysql.-community.”
mysql-connectors-community/aarch64 MySQL Connectors Community 36
mysql-tools-community/aarch64 MySQL Tools Community 13
mysql80-community/aarch64 MySQL 8.0 Community Server 33
[root@master ~]#
可以看到已经有了相关的安装包,接下来就是安装mysql
3,安装mysql
输⼊下⾯的安装命令:
[root@master ~]# yum install –y mysql-community-server
安装完成后,
启动mysql
[root@master ~]# systemctl start mysqld.service
查询状态
[root@master ~]# systemctl status mysqld.service
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-03-12 15:33:35 CST; 1h 45min ago
Docs: man:mysqld(8)
Process: 10165 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 10239 (mysqld)
Status: “SERVER_OPERATING”
CGroup: /system.slice/mysqld.service
忖10239 /usr/sbin/mysqld
Mar 12 15:33:13 master systemd[1]: Starting MySQL Server…
Mar 12 15:33:35 master systemd[1]: Started MySQL Server.
mysql下载下来是一个文件夹[root@master ~]#
查看初始密码
[root@master ~]# cat /var/log/mysqld.log
2019-03-12T07:29:30.111526Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld
8.0.15) MySQL Community Server - GPL.
2019-03-12T07:33:13.444733Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server in progress as process 10186
2019-03-12T07:33:24.093381Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: -.dqhAgnk6i8
2019-03-12T07:33:31.089426Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.15) initializing of server has completed
2019-03-12T07:33:33.982510Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 10239
2019-03-12T07:33:35.291228Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-03-12T07:33:35.369184Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version:
‘8.0.15’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 MySQL Community Server - GPL.
2019-03-12T07:33:35.460769Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket:
‘/var/run/mysqld/mysqlx.sock’ bind-address: ‘::’ port: 33060
⿊⾊字体的就是初始密码:
Mysql登录
[root@master ~]# mysql –u root –p
Enter password:
上⾯输⼊初始密码回车即可
修改初始密码:
Mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘你的密码’。设置密码最好是字母数字符号的组合,不然不会通过。
修改密码后,退出quit
然后重新⽤新密码登录即可
最后进⾏远程访问的授权
mysql> create user ‘root’@’%’ identified with mysql_native_password by ‘root’;
mysql> grant all privileges on . to ‘root’@’%’ with grant option;
mysql> flush privileges;
⾄此CentOS7+ARM下的mysql就安装完成了
遇到的问题:
在启动mysql时,systemctl start mysqld.service
出现:Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.
/var/log/mysqld.log 报错如下:
/usr/sbin/mysqld (mysqld 8.0.15) starting as process 7561
2019-03-12T05:55:03.334433Z 1 [ERROR] [MY-013090] [InnoDB] Unsupported redo log format (0). The redo log was created before MySQL 5.7.9
2019-03-12T05:55:03.334500Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2019-03-12T05:55:03.935589Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2019-03-12T05:55:03.936393Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-03-12T05:55:03.936879Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-03-12T05:55:03.939402Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld
8.0.15) MySQL Community Server - GPL.
解决办法:

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。