Linux ARM机器,源码安装mysql5.7.23,并且运行
背景:华为云 系统版本:EulerOS release 2.0 (SP8)
第一节:源码安装mysql5.7.23
一、下载
yum install ncurses-devel -y
yum install rpcgen -y
wget https://downloads.mysql.com/archives/get/file/mysql-boost-5.7.23.tar.gz
tar zxvf mysql-boost-5.7.23.tar.gz
cd mysql-5.7.23/
二、编译
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/opt/mysql-5.7.23/boost
注意:最后面指定的BOOST路径应该修改为mysql-5.7.23/boost的绝对路径。
如果没有出现错误,就是正常的 make && make install
三、遇到的错误
错误提示1:Curses library not found
解决方案:
rm -rf CMakeCache.txt
yum install ncurses-devel
从第二步重试(重新cmake)
错误提示2:Could not find rpcgen
解决方案:
rm -rf CMakeCache.txt
yum install rpcgen
从第二步重试(重新cmake)
错误提示3:Could not find rpc/rpc.h in /usr/include or /usr/include/tirpc
-- Running cmake version 3.12.1
-- Configuring with MAX_INDEXES = 64U
-- CMAKE_GENERATOR: Unix Makefiles
-- SIZEOF_VOIDP 8
-- MySQL 5.7.23
-- Packaging as: mysql-5.7.23-Linux-aarch64
-- Local boost dir /home/geostar/geoglobe/mysql/mysql-5.7.23/boost/boost_1_59_0
-- Found /home/geostar/geoglobe/mysql/mysql-5.7.23/boost/boost_1_59_0/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 105900
-- BOOST_INCLUDE_DIR /home/geostar/geoglobe/mysql/mysql-5.7.23/boost/boost_1_59_0
-- NUMA library missing or required version not available
-- WITH_PROTOBUF=bundled
-- protobuf version is 2.6
-- You need to set WITH_CURL. This variable needs to point to curl library.
-- Creating LDAP authentication SASL client library.
-- Required SASL library is missing. Skipping the LDAP SASL client authentication plugin.
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;atomic;dl
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlclient
-- MERGE_CONVENIENCE_LIBRARIES LIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib;yassl;taocrypt;dl
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib;yassl;taocrypt
CMake Error at rapid/plugin/group_replication/rpcgen.cmake:97 (MESSAGE):Could not find rpc/rpc.h in /usr/include or /usr/include/tirpc
Call Stack (most recent call first):rapid/plugin/group_replication/CMakeLists.txt:29 (INCLUDE)-- Configuring incomplete, errors occurred!
See also "/home/geostar/geoglobe/mysql/mysql-5.7.23/CMakeFiles/CMakeOutput.log".
See also "/home/geostar/geoglobe/mysql/mysql-5.7.23/CMakeFiles/CMakeError.log".
解决方案:
复制其他机器上面的rpc文件夹到这个文件夹中。
scp /usr/include/rpc/*.h root@192.168.1.1:/usr/include/rpc/.
上面只是示范,192.168.1.1是目标机器。上面的命令在原机器上执行
第二节:运行mysql
一、设置权限,添加mysql组和用户
使用下面的命令查看是否有mysql用户及用户组:
cat /etc/passwd //查看用户列表
cat /etc/group //查看用户组列表
如果没有就创建:
groupadd mysql //创建mysql组
useradd -g mysql mysql //创建属于mysql组的mysql用户
passwd mysql //为mysql用户创建登录密码
修改/usr/local/mysql权限:chown -R mysql:mysql /usr/local/mysql
二、加入环境变量
echo $PATH
export PATH=$PATH:/usr/local/mysql/bin
三、mysqld初始化
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --explicit_defaults_for_timestamp=true
2019-08-20T09:11:10.268167Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-08-20T09:11:10.442029Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-08-20T09:11:10.702832Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 739a0904-c32a-11e9-8108-fa163e8a366b.
2019-08-20T09:11:10.706663Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-08-20T09:11:10.707259Z 1 [Note] A temporary password is generated for root@localhost: 9cC5ycy(phS,
初始化成功后,上面结果会在控制台打印临时管理员密码,如:...root@localhost: 9cC5ycy(phS,其中9cC5ycy(phS就是密码。
说明:上面语句执行时容易报错,成功至少要满足以下几个条件
① /usr/local/mysql/data目录存在并且一定要为空目录,否则报错;
实例对应的datadir目录中,再启动此实例,然后重新执行初始化命令;
四、mysql服务启动
cd /usr/local/mysql/support-files
./mysql.server start
五、mysql安全模式修改root密码
如果使用上面的密码无论如何都登陆不进去,那么采用安全模式更改密码
cd /usr/local/mysql/bin
./mysqld_safe --skip-grant-tablesuse mysql
update user set password=password("你想要的密码") where user="root";
flush privileges;
然后终端输入mysql -uroot -p
使用mysql的后台命令。
注意,进入安全模式的时候需要没有mysql任何相关的进程,如果报错那就杀掉所有mysql相关的进程。
ps -aux | grep mysql | grep -v grep
kill -9 ***
六、mysql修改root密码
mysql> use mysql;
Database changed
mysql> select User from user; #此处为查询用户命令
+-----------+
| User |
+-----------+
| ******* |
| mysql.sys |
| root |
+-----------+
3 rows in set (0.00 sec)mysql> update user set password=password("*******") where user="*******"; #修改密码报错
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update mysql.user set authentication_string=password('*******') where user='*******'; #修改密码成功
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1mysql> flush privileges; #立即生效
Query OK, 0 rows affected (0.00 sec)
如果一直有问题,重复上面几个步骤
七、root用户,外网访问
mysql命令行
use mysql;
update user set host='%' where user = 'root';
flush privileges;
八、创建用户,并且赋予用户所有权限
进入mysql命令行后,
create user 'username'@'host' identified by 'password';
host 改为 % 意思是可以外网访问
grant all privileges on *.* to 'username'@'%' identified by 'password';
flush privileges;
Linux ARM机器,源码安装mysql5.7.23,并且运行相关推荐
- linux系统下源码安装mysql5.6数据库
linux系统下源码安装mysql5.6数据库 下载mysql数据库相关软件包(百度云盘:http://pan.baidu.com/s/1bnL31c7) 从mysql 5.5版本开始,mysql源码 ...
- Linux笔记-centos7源码安装Mysql5.6(图解详细)
关闭centos7防火墙 查看防火墙命令及关闭防火墙及永久关闭防火墙 systemctl status firewalld.service systemctl stop firewalld.servi ...
- centos下CMAKE源码安装MYSQL5.5.23
1.软件源代码包存放位置:/usr/local/src 源码包编译安装位置:/usr/local/软件名字 2.下载MySQL,CMAKE, http://www.cmake.org/files/v2 ...
- linux 自动安装mysql数据库_linux系统下源码安装mysql5.6数据库
linux系统下源码安装mysql5.6数据库 下载mysql数据库相关软件包(百度云盘:http://pan.baidu.com/s/1bnL31c7) 从mysql 5.5版本开始,mysql源码 ...
- linux安装源码mysql失败,linux停mysql源码安装
当前位置:我的异常网» Linux/Unix » linux停mysql源码安装 linux停mysql源码安装 www.myexceptions.net 网友分享于:2013-07-19 浏览: ...
- unbuntu cmake安装mysql_Ubuntu下源码安装MySQL-5.5.25a
Ubuntu下源码安装MySQL-5.5.25a,今天在Ubuntu Linux下本来玩玩Android的源码看下的.那小的怎看根目录的空间已然不多.所以想把 今天在Ubuntu Linux下本来玩玩 ...
- Linux上全源码安装Apache、MySQL、PHP、WSF安装(转载)
Linux上全源码安装Apache.MySQL.PHP.WSF安装 博客分类: PHP PHPMySQLApacheLinuxSQLite Linux上全源码安装Apache.MySQL.PHP.WS ...
- linux怎么用源码安装mysql,Linux源码安装mysql步骤
创建文件夹: mkdir /usr/local/webserver 安装必要依赖包 yum -y install gcc gcc-c++ make ncurses-devel 安装cmake包: t ...
- linux python3.8源码安装_linux 下从源码安装 Python——小白踩坑记
实验室服务器使用的系统为 Ubuntu 16.04,自带的 python 版本为 Python 2.7.12 和 Python 3.5.2,命令行下使用$ python命令来启动 python 时默认 ...
最新文章
- 亿级流量压力来袭,你的网站会被击垮吗?(上篇)
- 16 岁的雅虎问答,因“不再受欢迎”将永久关闭
- JavaScript实现Apache .htaccess 转化nginx生成器工具-toolfk程序员工具网
- 【推荐】JS面象对象编程视频教程
- 删除结果集中字段重复的方法
- 全栈深度学习第7期: 研究方向这么多,哪些是有有趣又潜力的呢?
- 计算机网络(九)-物理层(补充)-傅里叶变换-信道复用
- mysql并发死锁问题解决
- mysql 几何对象,几何(geometry)对象类型
- 深入理解JVM虚拟机笔记——类加载机制
- 海克斯棋开源程序 FutaHex2 编译教程
- 电梯远程监控系统方案
- Page Cache 与 Kafka 那些事儿
- 激光雷达错位拼接技术
- BP算法的反向传播和权值修正(1)
- 不用做实验也可以轻松找到癌症组织特异性基因
- 使用python编程语言编写程序:输入a、b、c三个数,判断a、b、c能否构成三角形,如果能够构成三角形,判断该三角形是等腰三角形还是等边三角形,还是直角三角形,还是一般三角形。并计算周长和面积。
- 华为云IOT的应用侧开发Java Demo使用详细教程(IntelliJ IDEA 开发)
- 社群营销运营分类包括哪些内容
- java构造函数可以抛出异常吗_关于java:使构造函数抛出异常是一种好习惯吗?...