当前位置:网站首页>Install MariaDB 10.5.7 (tar package installation)
Install MariaDB 10.5.7 (tar package installation)
2022-06-11 17:51:00 【Yabingshi】
One download
Mariadb Download address :http://downloads.mariadb.org
Check
You can choose to download the historical version database .
Two install
chattr -ia /etc/passwd
chattr -ia /etc/group
chattr -ia /etc/shadow
chattr -ia /etc/gshadow
groupadd mysql
useradd -g mysql mysql
passwd mysql
cd /opt/
tar -xvf mariadb-10.5.7-linux-systemd-x86_64.tar.gz -C /usr/local/
cd /usr/local/
mv mariadb-10.5.7-linux-systemd-x86_64 mysql
cd mysql
# install
./scripts/mysql_install_db --user=mysql

chown -R mysql:mysql /usr/local/mysql
# Set up PATH Variable
vi /root/.bash_profile
stay PATH Add... At the end of the line :
:/usr/local/mysql/bin
# Make variables effective
source /root/.bash_profile
3、 ... and Modify the configuration file
cd /etc
mv my.cnf my.cnf.backup
vi my.cnf, add to :
[mysqld]
local_infile=off
event_scheduler = 1
innodb_buffer_pool_size=500m
server_id=1
#log-basename=master
log_bin=master-bin
log_slave_updates=ON
port=3306
log_error=/usr/local/mysql/error.log
slow_query_log=1
long_query_time=2
binlog_format=ROW
innodb_flush_log_at_trx_commit=1
sync_binlog=1
character_set_server=utf8mb4
collation_server=utf8mb4_bin
max_allowed_packet=64M
max_connections=2000
max_connect_errors=1024
#tx_isolation=REPEATABLE-READ
skip-name-resolve=ON
expire_logs_days=30
log_bin_trust_function_creators=1
lower_case_table_names=1
innodb_log_file_size=512M
innodb_file_per_table=ON
slave-parallel-threads=32
slave_parallel_mode=optimistic
rpl_semi_sync_slave_enabled=ON
rpl_semi_sync_master_enabled=ON
rpl_semi_sync_master_wait_point=AFTER_SYNC
[client]
default-character-set=utf8/*
innodb_buffer_pool_size You can increase the memory size of your server , If only... Is deployed on the server mariadb Words , It is recommended to set to... Of the server memory 60%.
*/
Four Start database
# Set to systemctl Mode to start the database
cp /usr/local/mysql/support-files/systemd/mariadb.service /usr/lib/systemd/system/mariadb.service
Please note that , By default /usr/ The catalogue is made up of systemd Write protect , So when you put the data directory in the /usr/local/mysql/data In the middle of the day , You also need to make the directory writable . You can do this by adding additional service include files :
mkdir /etc/systemd/system/mariadb.service.d/
cat > /etc/systemd/system/mariadb.service.d/datadir.conf <<EOF
[Service]
ReadWriteDirectories=/usr/local/mysql
EOF
/*
What I initially configured according to the official website is ReadWritePaths=/usr/local/mysql/data, start-up mariadb Report errors :
/etc/systemd/system/mariadb.service.d/datadir.conf:2] Unknown lvalue 'ReadWritePaths' in section 'Service'
[ERROR] mariadbd: File '/usr/local/mariadb-10.5.7-linux-systemd-x86_64/data/aria_log_control' not found (Errcode: 30 "Read-only file system")
Maybe the operating system version is different , My is centos 7.6
*/
# Start database
systemctl daemon-reload
systemctl start mariadb
systemctl enable mariadb
5、 ... and Log in to the database
# Sign in mysql, The default password is empty

/*
If the database starts successfully , Login with error :
[[email protected] my.cnf.d]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[[email protected] etc]# which mysql
/usr/bin/mysql
Find out /usr/bin There's a next one. mysql file :
ll /usr/bin/mysql
If any , Delete this file , Open a new window to connect to the database .
*/
6、 ... and Account management
# Change account password
alter user [email protected]'localhost' identified by ' Custom password ';
# Delete empty password account
delete from mysql.user where password='';
# Delete accounts with illegal passwords
delete from mysql.user where password='invalid';
# establish root Remote account
grant all privileges on *.* to 'root'@'%' identified by ' Custom password ';
flush privileges;
-- This article refers to Installing MariaDB Binary Tarballs - MariaDB Knowledge Base
边栏推荐
- Don't you understand the design and principle of thread pool? Break it up and crush it. I'll teach you how to design the thread pool
- 6-7 文件读写操作
- CentOS7服务器配置(四)---安装redis
- adb 命令学习笔记
- R language mice package error in terms Formula (TMP, simplify = true): the model formula in extractvars is incorrect
- 智能化整体图例,布线、安防、广播会议、电视、楼宇、消防、电气图的图例【转自微信公众号弱电课堂】
- 7-1 均是素数
- [solution] codeforces round 798 (Div. 2)
- Use exe4j to convert The jar file is packaged as Exe file
- 信息安全数学基础 Chapter 3——有限域(二)
猜你喜欢

Kubernetes deploys elk and collects container logs using filebeat

为什么udp流设置1316字节

聚类方法汇总

Three steps of ffmpeg CBR precise bitstream control

有效的括号---2022/02/23

【深度学习基础】神经网络的学习(3)

ADB command learning notes

Use exe4j to convert The jar file is packaged as Exe file

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_ mod

Service学习笔记01-启动方式与生命周期
随机推荐
require和ES6 import的区别
6-2 多个整数的逆序输出-递归
信息安全数学基础 Chapter 2——同余
Use exe4j to convert The jar file is packaged as Exe file
论文阅读 dyngraph2vec: Capturing Network Dynamics using Dynamic Graph Representation Learning
Valid parentheses ---2022/02/23
6-2 writing articles (*)
6-3 读文章(*)
Tidb CDC synchronization of features not available in MySQL to MySQL
Summary of clustering methods
Tidb CDC log tables are not eligible to replicate
Delete the penultimate node of the linked list ---2022/02/22
6-2 reverse output of multiple integers recursion
Hash表、 继承
Threejs uses indexeddb cache to load GLB model
MFSR:一种新的推荐系统多级模糊相似度量
Bracket generation ---2022/02/25
Service学习笔记04- 其他服务实现方式与替代方式
智能化整体图例,布线、安防、广播会议、电视、楼宇、消防、电气图的图例【转自微信公众号弱电课堂】
【先收藏,早晚用得到】100个Flink高频面试题系列(一)