mariadb 10.1.26 二进制包安装笔记

时间:2024-07-02 22:07:14
报错链接:http://php.upupw.net/ank2discuss/40/6841-e.html

mariadb 10.1.26 二进制版本 

全名称:
mariadb-10.1.26-linux-x86_64.tar.gz
目的:
主从复制,读写分离安装教程 1. 官网下载二进制版本数据库 2. yum -y install libaio 因为报错:./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No 3. 新建用户
# cat /etc/passwd | grep mysql
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
# userdel mysql //删除rpm的用户
# useradd -M -s /sbin/nologin mysql
# groupadd mysql //添加用户组
# useradd -r -g mysql mysql 4. 配置权限 chmod +x /usr/local/mariadb/data 给放数据的文件夹执行权限
====================================================
5. 初始化 --》可以不用初始化直接启动
./scripts/mysql_install_db --skip-auth-anonymous-user --skip-name-resolve \
--basedir=/usr/local/mariadb_2 --datadir=/usr/local/mariadb_2/data \
--user=mysql 6. 启动 记得改socket目录权限 --》 这块出了很多问题,权限问题居多 ./bin/mysqld --defaults-file=/usr/local/mariadb_2/conf/my.cnf --user=mysql --basedir=/usr/local/mariadb_2
报错: 

/* 
[root@iz25oe9qr1rz mariadb_2]# ./bin/mysqld —defaults-file=/usr/local/mariadb_2/conf/my.cnf --user=mysql 2018-09-28 11:54:32 139714880300928 [Note]
./bin/mysqld (mysqld 10.1.26-MariaDB) starting as process 13217 ...
2018-09-28 11:54:32 139714880300928
[ERROR] Can't find messagefile '/usr/local/mysql/share/errmsg.sys'
2018-09-28 11:54:32 139714880300928 [ERROR] Aborting */ 因为没有指定MySQL自身的文件路径, 默认寻找系统的 解决办法,
加上--basedir=/usr/local/mariadb_2
c /* 2018-09-28 11:59:38 140334896084864 [Note]
./bin/mysqld (mysqld 10.1.26-MariaDB) starting as process 13218 ... 2018-09-28 11:59:38 140334896084864
[Warning] Can't create test file /var/lib/mysql/iz25oe9qr1rz.lower-test
./bin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2 "No such file or directory") */

权限这块, 凯哥全给MySQL了

mariadb 10.1.26 二进制包安装笔记

我觉得, conf和data给就行了,无所谓了呀

mysql8.0 基于debian的Linux系统安装

  https://blog.****.net/L141210113/article/details/82794918

  注意初始化,配置文件及配置文件位置, 权限