mariadb
1.下载 https://downloads.mariadb.org/mariadb/10.5.3/
2.解压后cmd执行 mysql_install_db.exe --datadir=D:\db --service=Mariadb --password=123456
"C:\Program Files\MariaDB 10.5\bin\mysqld.exe" "--defaults-file=D:\ProgramData\MySql
3.修改my.ini配置
[mysqld] datadir=C:/soft/mariadb-10.5.3-winx64/data character-set-server=utf8 port=6666 [client] plugin-dir=C:/soft/mariadb-10.5.3-winx64/lib/plugin port=6666
default-character-set=utf8
4.修改密码
set password for root@localhost = password('新密码');
5.支持root用户允许远程连接mysql数据库(密码不需要password函数)
grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
flush privileges;
6.忘记root密码,重置
1. [mysqld]
skip-grant-tables #跳过权限表
2.如果无效,再执行1次
set password for 'root'@'localhost'=password('123456');
flush privileges;
7.root有多个host和密码,直接删除多余的
8. mysqldump
-
uzabbix
-
p123456
-
-
opt
-
-
skip
-
lock
-
tables
-
-
database zabbix | gzip > zabbix_`date
+
'%Y%m%d%H%M%S'
`.sql.gz
9.根据脚本执行,在mysql中执行 source sqlfilepath