下载mariadb解压版
https://mariadb.org/download/
配置 my.cnf
解压后,新建 my.cnf 文件
修改如下(注意路径信息):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
| [client] port = 3306 default-character-set = utf8mb4
[mysqld] bind-address = 0.0.0.0 port = 3306
#路径信息 注意 basedir=E:\devtools\mariadb-10.11.2-winx64 datadir=E:\devtools\mariadb-10.11.2-winx64\data tmpdir=E:\devtools\mariadb-10.11.2-winx64\data
#编码信息 skip-character-set-client-handshake = true character_set_server = utf8mb4 collation_server = utf8mb4_unicode_ci init_connect='SET NAMES utf8mb4'
back_log = 50 max_connections = 100 wait_timeout = 256 max_connect_errors = 10
table_open_cache = 2048 max_allowed_packet = 16M binlog_cache_size = 512M max_heap_table_size = 512M
read_buffer_size = 64M read_rnd_buffer_size = 64M sort_buffer_size = 64M join_buffer_size = 64M
thread_cache_size = 8 thread_concurrency = 8 thread_stack = 240K
query_cache_size = 128M query_cache_limit = 2M ft_min_word_len = 4 default-storage-engine = InnoDB transaction_isolation = REPEATABLE-READ tmp_table_size = 512M
log-bin=mysql-bin binlog_format=mixed expire_logs_days = 7 max_binlog_size = 100m binlog_cache_size = 4m max_binlog_cache_size = 512m
slow_query_log = 1 long_query_time = 2
server-id = 1 # INNODB options innodb_buffer_pool_size = 4G innodb_buffer_pool_instances = 8 innodb_data_file_path = ibdata1:10M:autoextend
innodb_write_io_threads = 8 innodb_read_io_threads = 8
innodb_thread_concurrency = 16 innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 1GB innodb_change_buffering = all innodb_change_buffer_max_size = 25
innodb_log_file_size = 512M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 90 innodb_lock_wait_timeout = 256
[mysqldump] quick max_allowed_packet = 50M
[mysql] no-auto-rehash default-character-set=utf8mb4 [mysqlhotcopy] interactive-timeout
[mysqld_safe] open-files-limit = 8192
|
打开cmd,输入
默认root密码为空
启动
输入mysqld启动
进入mariadb查看
创建用户并授权
1 2 3 4 5 6 7 8 9 10
| -- 创建数据库 dbname0311 create database dbname0311;
-- 创建用户 zhangsan zhangsan123456 create user 'zhangsan'@'%' identified by 'zhangsan123456';
-- 授权 zhangsan 访问 dbname0311 数据库的所有权限 GRANT ALL PRIVILEGES ON dbname0311.* TO 'zhangsan'@'%';
flush privileges;
|
1 2
| # 查看版本信息 select version()
|
1 2
| localhost -> 表示只能本机能连接Mariadb % -> 表示任何客户机都能连接Mariadb
|
完