之前是用的mysql,因为有些细节当时没功夫搞,导致MariaDB运行不起来,今天捣鼓了一下,步骤如下:
首先要看一下pkg里面有哪些版本,选个自己想用的,我这用的是103:
pkg search mariadb pkg install mariadb103-client-10.3.12 mariadb103-server-10.3.12
然后设置一下,以及让这个服务启动:
sysrc mysql_enable=YES sysrc mysql_pidfile=/var/db/mysql/mysql.pid sysrc mysql_optfile=/usr/local/etc/my.cnf service mysql-server start
安装的时候会提示配置文件应该存放的位置,两个取其一即可,我自用配置:
[mysqld] bind-address = :: #skip-innodb default-storage-engine=MYISAM skip-name-resolve lower_case_table_names = 1 group_concat_max_len=-1 aria_pagecache_buffer_size=4M performance_schema = off key_buffer_size = 4M max_allowed_packet = 1000M thread_stack = 192K thread_cache_size = 8 myisam_recover_options = BACKUP max_connections = 1000 table_cache = 64 thread_concurrency = 10 query_cache_limit = 1M query_cache_size = 16M log_error = /var/log/mysql/error.log expire_logs_days = 1 max_binlog_size = 100M character-set-server = utf8 collation-server = utf8_general_ci
其他的跟之前文章里的mysql全都一样,像/usr/local/bin/mysql_secure_installation 这些,就不重复写了。