当前位置:Gxlcms > 数据库问题 > linux之mariadb的安装

linux之mariadb的安装

时间:2021-07-01 10:21:17 帮助过:3人阅读

的分支-- mysql (自己本身) -- 2008前后的被SUN收购 SUN之后又被oracle收购

              系统集成--什么都干(- 套解决方案)

              mariadb  mysql被收购后,作者为了避免数据库被垄断,作者基于mysql的早期版本开发了mariadb

              percona-server  在欧洲,专门mysql数据库写手册,

       postgre SQL  自己说自己是关系型数据路行业老大的一家公司

       oracle  最流行的数据库

       mssql  微软数据库

2、mariadb的安装

  (1) 创建用户

  1. [root@localhost ~]# groupadd mysql
  2. [root@localhost ~]# useradd -r -g mysql -s /sbin/nologin mysql

  (2)解压并安装

  1. [root@localhost ~]# tar xf mariadb-5.5.65-linux-systemd-x86_64.gz
  2. [root@localhost ~]# mv mariadb-5.5.65-linux-systemd-x86_64 /usr/local/mysql

  (3)编辑my.cnf文件

    

  1. [root@localhost mysql]# cp support-files/my-small.cnf /etc/my.cnf
  2. cp: overwrite ‘/etc/my.cnf’? y
  3. [root@localhost mysql]# vim /etc/my.cnf<br>  [mysqld]
  4.   port = 3306
  5.   socket = /tmp/mysql.sock
  6.   skip-external-locking
  7.   key_buffer_size = 16K
  8.   max_allowed_packet = 1M
  9.   table_open_cache = 4
  10.   sort_buffer_size = 64K
  11.   read_buffer_size = 256K
  12.   read_rnd_buffer_size = 256K
  13.   net_buffer_length = 2K
  14.   thread_stack = 240K
  15.   basedir = /usr/local/mysql
  16.   datadir = /usr/local/mysql/data
  17.   innodb_file_per_table=on
  18.   skip_name_resolve = on<br>#给mysql用户权限<br>[root@localhost mysql]# chown -R mysql.mysql /usr/local/mysql/
  19. [root@localhost mysql]# chmod -R 755 /usr/local/mysql/

 初始化mysql

  1. [root@localhost mysql]# /usr/local/mysql/scripts/mysql_install_db --user=mysql
  2. Installing MariaDB/MySQL system tables in ‘/usr/local/mysql/data‘ ...
  3. 190910 12:38:06 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.65-MariaDB) starting as process 12547 ...
  4. OK
  5. Filling help tables...
  6. 190910 12:38:06 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.65-MariaDB) starting as process 12556 ...
  7. OK

 将mysql服务添加到init.d中

  1. [root@localhost mysql]# cd support-files/
  2. [root@localhost support-files]# cp -a mysql.server /etc/init.d/mysqld<br>启动mysql
  3. [root@localhost support-files]# /etc/init.d/mysqld start
  4. Starting MariaDB.190910 12:40:15 mysqld_safe Logging to ‘/usr/local/mysql/data/localhost.localdomain.err‘.
  5. 190910 12:40:15 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
  6. . SUCCESS!

 

linux之mariadb的安装

标签:初始化   stack   host   sys   微软   方案   arp   cal   safe   

人气教程排行