码迷,mamicode.com
首页 > 数据库 > 详细

MariaDBa安装备忘

时间:2018-01-27 11:35:42      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:usr   10g   tab   innodb   配置文件   添加   $path   name   efault   

(1)准备数据目录

# fdisk -l
# fdisk /dev/sdb
# pvcreate /dev/sdb1
# vgs
# vgcreate yuyang /dev/sdb1
# lvcreate -L 10G -n mydata yuyang
# yum install xfsprogs
# modprobe xfs
# mkfs.xfs /dev/yuyang/mydata
# mkdir /mydata
# vim /etc/fstab
    #添加
    /dev/yuyang/mydata      /mydata                 xfs     defaults        0 0 
# mount -a
# cd /mydata/
# mkdir data
# chown mysql.mysql data

(2)安装mariadb

# groupadd -r mysql
# useradd -r -g mysql mysql
# tar xf mariadb-5.5.59-linux-x86_64.tar.gz -C /usr/local/
# cd /usr/local/
# ln -sv mariadb-5.5.59-linux-x86_64/ mysql
# cd mysql/
# chown -R root:mysql ./*
# scripts/mysql_install_db --help
# scripts/mysql_install_db --user=mysql --datadir=/mydata/data
# echo ‘PATH=/usr/local/mysql/bin:$PATH‘ > /etc/profile.d/mysqld.sh

(3)准备配置文件

# mkdir /etc/mysql
# cd mysql/
# cd support-files/
# cp my-large.cnf /etc/mysql/my.cnf
# vim /etc/mysql/my.cnf 
  #添加:
    innodb_file_per_table = on
    skip_name_resolve = on

(4)启动服务

touch /var/log/mysqld.log
chown mysql.mysql /var/log/mysqld.log 
service mysqld start
ss -tanl

MariaDBa安装备忘

标签:usr   10g   tab   innodb   配置文件   添加   $path   name   efault   

原文地址:http://blog.51cto.com/2143754/2065703

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!