当前位置:网站首页>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
边栏推荐
- Chorus翻译
- Service learning notes 02- actual combat startservice and bindservice
- 6-1 read string (*) from file
- 6-8 有结构文件的读写1
- 信息安全数学基础 Chapter 4——二次剩余与方根
- Tidb unsafe recover (tikv downtime is greater than or equal to half the number of replicas)
- ForEach遍历集合、 集合容器
- 光纤熔接知识汇总【转载自微信公众号弱电智能化工程2018】
- "College entrance examination" volume sent to the big model: 442 people put forward 204 tasks to the big model, led by Google
- 自动化测试-Selenium
猜你喜欢

MFSR:一种新的推荐系统多级模糊相似度量

ffmpeg奇偶场帧Interlace progressive命令和代码处理

Service学习笔记01-启动方式与生命周期

【先收藏,早晚用得到】49个Flink高频面试题系列(二)

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

Getting started with Wireshark

Leetcode力扣刷题

Semaphore PV operation of process interaction and its code implementation

Three steps of ffmpeg CBR precise bitstream control

CLP information -5 keywords to see the development trend of the financial industry in 2022
随机推荐
为什么udp流设置1316字节
Why is the UDP stream set to 1316 bytes
开源项目那么多,这次带你了解个版本的区别,明白alpha版、beta版、rc版是什么意思
CLP information -5 keywords to see the development trend of the financial industry in 2022
Hash table, inheritance
6-2 多个整数的逆序输出-递归
Tidb lightning configuration data restore route
Summary of clustering methods
6-3 reading articles (*)
6-8 reading and writing of structured files 1
Ffmpeg hard codec inter QSV
Intelligent overall legend, legend of wiring, security, radio conference, television, building, fire protection and electrical diagram [transferred from wechat official account weak current classroom]
6-3 批量求和(*)
adb 命令学习笔记
Go get downloaded package path
Service学习笔记03- 前台服务实战
合并K个升序链表---2022/02/26
6-3 读文章(*)
Service learning notes 01 start method and life cycle
Bracket generation ---2022/02/25