- 前往官网(https://downloads.mariadb.org/)下载安装包,如:mariadb-10.5.6-winx64.zip
- 解压缩到指定目录D:\MariaDB,并创建数据目录data
- 以管理员身份运行命令行窗口,定位到安装目录\bin
- 执行安装命令mysql_install_db.exe --datadir=D:\mdb --service=MariaDB --password=123456
- 启停服务 net start/stop MariaDB
- 登录 mysql -u root -p(按提示输入密码)
修改编码
- MariaDB [(none)]> set character_set_client=utf8;
- MariaDB [(none)]> set character_set_connection=utf8;
- MariaDB [(none)]> set character_set_database=utf8;
- MariaDB [(none)]> set character_set_results=utf8;
- MariaDB [(none)]> set character_set_server=utf8;
- MariaDB [(none)]> set character_set_system=utf8;
- MariaDB [(none)]> show variables like 'character%';
MariaDB.bat
@echo off&title %~n0
rem pw=123456 - bi202009021537
cmd /k "cd /d D:\MariaDB\bin\&&mysql -u root -p"