2、配置MariaDB
#cd /appliction/mysql
#scripts/mysql_install_db --user=mysql --datadir=/appliction/mydata
复制配置文档
#cd /appliction/mysql/support-files/
#cp my-large.cnf /etc/my.cnf
创建启动脚本
# cd /appliction/mysql/support-files/
# cp mysql.server /etc/rc.d/init.d/mysqld
配置环境变量,方便直接输入mysql
# cat /etc/profile.d/mysql.sh
MYSQL_HOME=/appliction/mysql
export PATH=$MYSQL_HOME/bin:$PATH
#source /etc/profile.d/mysql.sh
启动数据库
# /etc/rc.d/init.d/mysqld start登陆数据库,不需要密码
报错rm -f /tmp/mysql.sock
# mysql
qld start
Reloading systemd: [ OK ]
Starting mysqld (via systemctl): [ OK ]
初始化数据库,此方式可以禁用空密码登陆,按照提示输入你需要的Y或者N
# mysql_secure_installation
设置mysql本地方式免密码登陆
# egrep -v "^$|#" /etc/my.cnf (增加了红色部分)
[client]
port= 3306
socket= /tmp/mysql.sock
[mysqld]
port= 3306
socket= /tmp/mysql.sock
basedir=/usr/local/mysql(安装数据库目录)
datadir=/home/mydata(数据存放目录)
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
thread_concurrency = 8
log-bin=mysql-bin
binlog_format=mixed
server-id= 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
user = root
password = 123456
host = 127.0.0.1
[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Ubuntu 16.04 LTS 上安装 Nginx、MariaDB 和 HHVM 运行 WordPress
Ubuntu 16.04 Dockerfile 安装MariaDB
CentOS系统使用yum安装MariaDB数据库
Ubuntu 上如何将 MySQL 5.5 数据库迁移到 MariaDB 10
[翻译]Ubuntu 14.04 (Trusty) Server 安装 MariaDB