linux之mariadb的安装
程序员文章站
2022-09-27 17:36:23
1、概述 mysql为关系型数据库。 mysql的分支-- mysql (自己本身) -- 2008前后的被SUN收购 SUN之后又被oracle收购 系统集成--什么都干(- 套解决方案) mariadb mysql被收购后,作者为了避免数据库被垄断,作者基于mysql的早期版本开发了mariad ......
1、概述
mysql为关系型数据库。
mysql的分支-- mysql (自己本身) -- 2008前后的被sun收购 sun之后又被oracle收购
系统集成--什么都干(- 套解决方案)
mariadb mysql被收购后,作者为了避免数据库被垄断,作者基于mysql的早期版本开发了mariadb
percona-server 在欧洲,专门mysql数据库写手册,
postgre sql 自己说自己是关系型数据路行业老大的一家公司
oracle 最流行的数据库
mssql 微软数据库
2、mariadb的安装
(1) 创建用户
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -r -g mysql -s /sbin/nologin mysql
(2)解压并安装
[root@localhost ~]# tar xf mariadb-5.5.65-linux-systemd-x86_64.gz
[root@localhost ~]# mv mariadb-5.5.65-linux-systemd-x86_64 /usr/local/mysql
(3)编辑my.cnf文件
[root@localhost mysql]# cp support-files/my-small.cnf /etc/my.cnf
cp: overwrite ‘/etc/my.cnf’? y
[root@localhost mysql]# vim /etc/my.cnf
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16k
max_allowed_packet = 1m
table_open_cache = 4
sort_buffer_size = 64k
read_buffer_size = 256k
read_rnd_buffer_size = 256k
net_buffer_length = 2k
thread_stack = 240k
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
innodb_file_per_table=on
skip_name_resolve = on
#给mysql用户权限
[root@localhost mysql]# chown -r mysql.mysql /usr/local/mysql/
[root@localhost mysql]# chmod -r 755 /usr/local/mysql/
初始化mysql
[root@localhost mysql]# /usr/local/mysql/scripts/mysql_install_db --user=mysql
installing mariadb/mysql system tables in '/usr/local/mysql/data' ...
190910 12:38:06 [note] /usr/local/mysql/bin/mysqld (mysqld 5.5.65-mariadb) starting as process 12547 ...
ok
filling help tables...
190910 12:38:06 [note] /usr/local/mysql/bin/mysqld (mysqld 5.5.65-mariadb) starting as process 12556 ...
ok
将mysql服务添加到init.d中
[root@localhost mysql]# cd support-files/
[root@localhost support-files]# cp -a mysql.server /etc/init.d/mysqld
启动mysql
[root@localhost support-files]# /etc/init.d/mysqld start
starting mariadb.190910 12:40:15 mysqld_safe logging to '/usr/local/mysql/data/localhost.localdomain.err'.
190910 12:40:15 mysqld_safe starting mysqld daemon with databases from /usr/local/mysql/data
. success!
上一篇: 大数据常用软件安装指南
下一篇: 算法题|-灯泡开关问题