Linux下编译安装MariaDB-10.4.10

#安装下载与说明
首先需要到去MariaDB官网下载安装包,首页是:https://downloads.mariadb.org/
Linux下编译安装MariaDB-10.4.10_第1张图片

wget https://downloads.mariadb.org/interstitial/mariadb-10.4.10/source/mariadb-10.4.10.tar.gz/from/http%3A//ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/
mv index.html mariadb-10.4.10.tar.gz (会保成到index.html文件,需要更改一下文件名)
tar -xvzf mariadb-10.4.10.tar.gz
cd mariadb-10.4.10/
yum -y install zlib-devel
yum -y install openssl-devel
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make   (安装差不多一个小时,我也是醉了 cmake的原因吗?)
make install

安装配置

useradd mysql
chown -R mysql:mysql   /usr/local/mysql/data
cp support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
/usr/local/mysql/scripts/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf
 /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf

出现权限错误

2019-11-12 14:24:17 0 [Warning] No argument was provided to --log-bin and neither --log-basename or --log-bin-index where used;  This may cause repliction to break when this server acts as a master and has its hostname changed! Please use '--log-basename=VM_6_235_centos' or '--log-bin=VM_6_235_centos-bin' to avoid this problem.
2019-11-12 14:24:17 0 [ERROR] mysqld: File './VM_6_235_centos-bin.index' not found (Errcode: 13 "Permission denied")
2019-11-12 14:24:17 0 [ERROR] Aborting

解决方法
Linux下编译安装MariaDB-10.4.10_第2张图片

Linux下编译安装MariaDB-10.4.10_第3张图片
解决 centos-bin.index’ not found (Errcode: 13 “Permission denied”) 问题

chown -R mysql:mysql /usr/local/mysql/data

重新启动脚本

/usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf &

将mysqld添加至系统服务:

chkconfig --add mysqld   # 添加至系统服务
chkconfig mysqld on    # 设置开机自启动

添加用户

# 添加 mysqlplayer 密码 123123
GRANT ALL PRIVILEGES ON *.* TO mysqlplayer@'%'  IDENTIFIED BY '123123' WITH GRANT OPTION;
flush privileges; #刷新权限

你可能感兴趣的:(linux软件)