Linux学习-基于CentOS7的MariaDB数据库的安装

一、实验环境:

  系统:CentOS7.6,关闭了防火墙与SELINUX

  数据库版本:mariadb-10.2.25(二进制安装与源码安装)

二、安装方法:

1、yum源安装

 (1) 配置yum源,官方yum源下载太慢,用国内的镜像源吧

[[email protected] ~]# cat /etc/yum.repos.d/mariadb.repo
# MariaDB 10.2 CentOS repository list - created 2019-11-29 02:18 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/10.2/centos7-amd64/
gpgcheck=0

 (2) 开始安装

[[email protected] ~]# yum install -y MariaDB-server MariaDB-client

 (3) 启动服务

[[email protected] ~]# systemctl start mariadb
[[email protected] ~]# ss -nlt
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port
LISTEN     0      128               *:111                           *:*
LISTEN     0      128               *:6000                          *:*
LISTEN     0      5      192.168.122.1:53                            *:*
LISTEN     0      128               *:22                            *:*
LISTEN     0      128       127.0.0.1:631                           *:*
LISTEN     0      100       127.0.0.1:25                            *:*
LISTEN     0      80               :::3306                         :::*
LISTEN     0      128              :::111                          :::*
LISTEN     0      128              :::6000                         :::*
LISTEN     0      128              :::22                           :::*
LISTEN     0      128             ::1:631                          :::*
LISTEN     0      100             ::1:25                           :::*
[[email protected] ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.2.29-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

MariaDB [(none)]> 

 (4) 设置mysql密码,可以用/usr/bin/mysqladmin -u root password ‘new-password‘ 设置,或使用安全脚本设置,以下为用脚本设置

[[email protected] ~]# /usr/bin/mysql_secure_installation
#使用脚本交互式设置
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we‘ll need the current
password for the root user.  If you‘ve just installed MariaDB, and
you haven‘t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from ‘localhost‘.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named ‘test‘ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you‘ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

2、源码安装

 (1) 先下载文件到服务器

[[email protected] ~]# ll mariadb-10.2.25.tar.gz
-rw-r--r-- 1 root root 71997847 Nov 29 11:40 mariadb-10.2.25.tar.gz

 (2) 安装相应的包

[[email protected] ~]# yum install -y bison bison-devel zlib-devel libcurl-devel libarchive-devel boost-devel gcc gcc-c++ cmake ncurses-devel gnutls-devel libxml2-devel openssl-devel libevent-devel libaio-devel libdb-cxx-devel

 (3) 新建mysql用户和数据目录

[[email protected] ~]# useradd -r -s /sbin/nologin -d /data/mysql mysql
[[email protected] ~]# mkdir /data/mysql
[[email protected] ~]# chown mysql:mysql /data/mysql
[[email protected] ~]# tar -zxvf mariadb-10.2.25.tar.gz

 (4) cmake编译安装

[[email protected] ~]# cd mariadb-10.2.25/
[[email protected] mariadb-10.2.25]# cmake . > -DCMAKE_INSTALL_PREFIX=/app/mysql > -DMYSQL_DATADIR=/data/mysql/ > -DSYSCONFDIR=/etc/ > -DMYSQL_USER=mysql > -DWITH_INNOBASE_STORAGE_ENGINE=1 > -DWITH_ARCHIVE_STORAGE_ENGINE=1 > -DWITH_BLACKHOLE_STORAGE_ENGINE=1 > -DWITH_PARTITION_STORAGE_ENGINE=1 > -DWITHOUT_MROONGA_STORAGE_ENGINE=1 > -DWITH_DEBUG=0 > -DWITH_READLINE=1 > -DWITH_SSL=system > -DWITH_ZLIB=system > -DWITH_LIBWRAP=0 > -DENABLED_LOCAL_INFILE=1 > -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock > -DDEFAULT_CHARSET=utf8 > -DDEFAULT_COLLATION=utf8_general_ci
[[email protected] mariadb-10.2.25]# make && make install
#提示:如果出错,执行rm -f CMakeCache.txt

 (5) 安装完成后,配置环境变量

[[email protected] mariadb-10.2.25]# echo ‘PATH=/app/mysql/bin:$PATH‘ > /etc/profile.d/mysql.sh
[[email protected] mariadb-10.2.25]# . /etc/profile.d/mysql.sh
[[email protected] mariadb-10.2.25]# echo $PATH
/app/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

 (6) 初始化数据库,生成数据库文件

[[email protected] bin]# cd /app/mysql/
[[email protected] mysql]# scripts/mysql_install_db --datadir=/data/mysql --user=mysql
Installing MariaDB/MySQL system tables in ‘/data/mysql‘ ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

‘./bin/mysqladmin‘ -u root password ‘new-password‘
‘./bin/mysqladmin‘ -u root -h centos7.localdomain password ‘new-password‘

Alternatively you can run:
‘./bin/mysql_secure_installation‘

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd ‘.‘ ; ./bin/mysqld_safe --datadir=‘/data/mysql‘

You can test the MariaDB daemon with mysql-test-run.pl
cd ‘./mysql-test‘ ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB‘s strong and vibrant community:
https://mariadb.org/get-involved/

 (7) 准备配置文件与启动脚本

[[email protected] mysql]# cp /app/mysql/support-files/my-huge.cnf /etc/my.cnf
[[email protected] mysql]# cp /app/mysql/support-files/mysql.server /etc/init.d/mysqld

 (8) 启动服务

[[email protected] mysql]# chkconfig --add mysqld
[[email protected] mysql]# service mysqld start
[[email protected] mysql]# ss -ntlp|grep 3306
LISTEN     0      80          :::3306                    :::*                   users:(("mysqld",pid=97848,fd=21))

3、二进制程序包安装

 (1) 先下载二进制程序包到服务器

[[email protected] ~]# ll mariadb-10.2.25-linux-x86_64.tar.gz
-rw-r--r-- 1 root root 457955398 Nov 29 13:32 mariadb-10.2.25-linux-x86_64.tar.gz

 (2) 新建mysql用户与数据目录

[[email protected] ~]# useradd -r -s /sbin/nologin -d /data/mysql mysql
[[email protected] ~]# mkdir /data/mysql
[[email protected] ~]# chown mysql:mysql /data/mysql/

 (3) 准备二进制程序

[[email protected] ~]# tar -zxvf mariadb-10.2.25-linux-x86_64.tar.gz -C /usr/local
[[email protected] ~]# cd /usr/local/
[[email protected] local]# ln -sv mariadb-10.2.25-linux-x86_64 mysql
‘mysql’ -> ‘mariadb-10.2.25-linux-x86_64’
[[email protected] local]# chown -R root:mysql /usr/local/mysql/

 (4) 准备配置文件

[[email protected] mysql]# mkdir /etc/mysql
[[email protected] mysql]# cp support-files/my-large.cnf /etc/mysql/my.cnf
[[email protected] mysql]# vim /etc/mysql/my.cnf
#在[mysqld]中添加下面三个选项:
datadir    = /data/mysql
innodb_file_per_table = on
skip_name_resolve = on        #禁止主机名解析,建议使用

 (5) 初始化数据库,生成数据库文件

[[email protected] ~]# cd /usr/local/mysql
[[email protected] mysql]# ./scripts/mysql_install_db --datadir=/data/mysql --user=mysql
Installing MariaDB/MySQL system tables in ‘/data/mysql‘ ...
2019-11-29 13:53:32 140116365457216 [Warning] ‘THREAD_CONCURRENCY‘ is deprecated and will be removed in a future release.
2019-11-29 13:53:33 140116364871424 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table ‘mysql.gtid_slave_pos‘ doesn‘t exist
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

‘./bin/mysqladmin‘ -u root password ‘new-password‘
‘./bin/mysqladmin‘ -u root -h centos7.localdomain password ‘new-password‘

Alternatively you can run:
‘./bin/mysql_secure_installation‘

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd ‘.‘ ; ./bin/mysqld_safe --datadir=‘/data/mysql‘

You can test the MariaDB daemon with mysql-test-run.pl
cd ‘./mysql-test‘ ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB‘s strong and vibrant community:
https://mariadb.org/get-involved/

 (6) 准备服务脚本,并启动服务

[[email protected] mysql]# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
[[email protected] mysql]# chkconfig --add mysqld
[[email protected] mysql]# service mysqld start
Starting mysqld (via systemctl):                           [  OK  ]

 (7) 配置PATH变量

[[email protected] mysql]# echo ‘PATH=/usr/local/mysql/bin:$PATH‘ > /etc/profile.d/mysql.sh
[[email protected] mysql]# . /etc/profile.d/mysql.sh
[[email protected] mysql]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.2.25-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

MariaDB [(none)]>

 (8) 安装后数据库是没有密码的,可以使用安全初始化脚本修改密码

[[email protected]os7 mysql]# /usr/local/mysql/bin/mysql_secure_installation
#或用以下命令,前提是PATH变量已配好
[[email protected] mysql]# mysql_secure_installation

三、多实例的配置

 以二进制程序包进行配置

 (1) 先下载二进制程序包到服务器

[[email protected] ~]# ll mariadb-10.2.25-linux-x86_64.tar.gz
-rw-r--r-- 1 root root 457955398 Nov 29 14:12 mariadb-10.2.25-linux-x86_64.tar.gz

 (2) 新建mysql用户与数据目录

[[email protected] ~]# useradd -r -s /sbin/nologin -d /data/mysql mysql
[[email protected] ~]# mkdir -pv /mysql/{3306,3307,3308}/{etc,data,bin,log,socket,pid}
[[email protected] ~]# tree /mysql
/mysql
├── 3306
│   ├── bin
│   ├── data
│   ├── etc
│   ├── log
│   ├── pid
│   └── socket
├── 3307
│   ├── bin
│   ├── data
│   ├── etc
│   ├── log
│   ├── pid
│   └── socket
└── 3308
    ├── bin
    ├── data
    ├── etc
    ├── log
    ├── pid
    └── socket

21 directories, 0 files
[[email protected] ~]# chown -R mysql:mysql /mysql

 (3) 解压二进制程序包并初始化生成数据库文件到各实例目录

[[email protected] ~]# tar -zxvf mariadb-10.2.25-linux-x86_64.tar.gz -C /usr/local
[[email protected] ~]# cd /usr/local/
[[email protected] local]# ln -sv mariadb-10.2.25-linux-x86_64 mysql
[[email protected] local]# chown -R root:mysql /usr/local/mysql/
[[email protected] mysql]# cd /usr/local/mysql/
[[email protected] mysql]# ./scripts/mysql_install_db --datadir=/mysql/3306/data/ --user=mysql
[[email protected] mysql]# ./scripts/mysql_install_db --datadir=/mysql/3307/data/ --user=mysql
[[email protected] mysql]# ./scripts/mysql_install_db --datadir=/mysql/3308/data/ --user=mysql

 (4) 准备各实例的配置文件

[[email protected] mysql]# pwd
/usr/local/mysql
[[email protected] mysql]# cp support-files/my-huge.cnf /mysql/3306/etc/my.cnf
[[email protected] mysql]# vim /mysql/3306/etc/my.cnf
[[email protected] mysql]# grep -vE ‘#|^$‘ /mysql/3306/etc/my.cnf
[client]
port        = 3306    #修改点
socket    = /mysql/3306/socket/mysql.sock
[mysqld]
port        = 3306    #修改点
datadir    =/mysql/3306/data    #修改点 没有则添加
socket    = /mysql/3306/socket/mysql.sock #修改点
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
thread_concurrency = 8
log-bin=mysql-bin
server-id    = 1    #修改点
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]    #修改点 没有则添加
log-error = /mysql/3306/log/mariadb.log   #修改点 没有则添加
pid-file  = /mysql/3306/pid/mariadb.pid    #修改点 没有则添加
[[email protected] mysql]# cp /mysql/3306/etc/my.cnf /mysql/3307/etc/
[[email protected] mysql]# cp /mysql/3306/etc/my.cnf /mysql/3308/etc/
[[email protected] mysql]# sed -i ‘s/3306/3307/g‘ /mysql/3307/etc/my.cnf
[[email protected] mysql]# sed -i ‘s/3306/3308/g‘ /mysql/3308/etc/my.cnf
[[email protected] mysql]# sed -ir ‘s/^server-id.*/server-id = 2/‘ /mysql/3307/etc/my.cnf
[[email protected] mysql]# sed -ir ‘s/^server-id.*/server-id = 3/‘ /mysql/3308/etc/my.cnf

 (5) 准备启动服务脚本

[[email protected] mysql]# cd /mysql/3306/bin/
[[email protected] bin]# vim mysqld
[[email protected] bin]# cat mysqld
#!/bin/bash

port=3306    #端口号记得要改
mysql_user="root"    #数据库用户名
mysql_pwd=""   #数据库密码,因初始化时是没有密码的,此外先为空,后续记得改
cmd_path="/usr/local/mysql/bin"   #命令路径
mysql_basedir="/mysql"
mysql_sock="${mysql_basedir}/${port}/socket/mysql.sock"

function_start_mysql()
{
    if [ ! -e "$mysql_sock" ];then
      printf "Starting MySQL...\n"
      ${cmd_path}/mysqld_safe --defaults-file=${mysql_basedir}/${port}/etc/my.cnf  &> /dev/null  &
    else
      printf "MySQL is running...\n"
      exit
    fi
}

function_stop_mysql()
{
    if [ ! -e "$mysql_sock" ];then
       printf "MySQL is stopped...\n"
       exit
    else
       printf "Stoping MySQL...\n"
       ${cmd_path}/mysqladmin -u ${mysql_user} -p${mysql_pwd} -S ${mysql_sock} shutdown
   fi
}

function_restart_mysql()
{
    printf "Restarting MySQL...\n"
    function_stop_mysql
    sleep 2
    function_start_mysql
}

case $1 in
start)
    function_start_mysql
;;
stop)
    function_stop_mysql
;;
restart)
    function_restart_mysql
;;
*)
    printf "Usage: ${mysql_basedir}/${port}/bin/mysqld {start|stop|restart}\n"
esac

[[email protected] bin]# cp mysqld /mysql/3307/bin/
[[email protected] bin]# cp mysqld /mysql/3308/bin/
[[email protected] bin]# sed -i ‘s/3306/3307/g‘ /mysql/3307/bin/mysqld
[[email protected] bin]# sed -i ‘s/3306/3308/g‘ /mysql/3308/bin/mysqld
[[email protected] bin]# chown -R mysql:mysql /mysql
[[email protected] bin]# chmod +x /mysql/{3306,3307,3308}/bin/mysqld
[[email protected] bin]# /mysql/3306/bin/mysqld start
Starting MySQL...
[[email protected] bin]# /mysql/3307/bin/mysqld start
Starting MySQL...
[[email protected] bin]# /mysql/3308/bin/mysqld start
Starting MySQL...
[[email protected] bin]# ss -nlt | grep 330*
LISTEN     0      80          :::3306                    :::*
LISTEN     0      80          :::3307                    :::*
LISTEN     0      80          :::3308                    :::*  

 (6) 配置PATH变量,使用mysql客户端测试

[[email protected] bin]# cd /usr/local/mysql/
[[email protected] mysql]# echo ‘PATH=/usr/local/mysql/bin:$PATH‘ > /etc/profile.d/mysql.sh
[[email protected] mysql]# . /etc/profile.d/mysql.sh
#使用不同端口socket文件连接不同的实例
[[email protected] mysql]# mysql -S /mysql/3306/socket/mysql.sock
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.25-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

MariaDB [(none)]> status
--------------
mysql  Ver 15.1 Distrib 10.2.25-MariaDB, for Linux (x86_64) using readline 5.1

Connection id:        9
Current database:
Current user:        [email protected]
SSL:            Not in use
Current pager:        stdout
Using outfile:        ‘‘
Using delimiter:    ;
Server:            MariaDB
Server version:        10.2.25-MariaDB-log MariaDB Server
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:        /mysql/3306/socket/mysql.sock
Uptime:            14 min 8 sec

Threads: 8  Questions: 4  Slow queries: 0  Opens: 17  Flush tables: 1  Open tables: 11  Queries per second avg: 0.004
--------------

 (7) 关闭数据库与修改数据库登录密码

[[email protected] mysql]# /mysql/3306/bin/mysqld stop
#关闭数据库时,因密码为空,所以关闭时提示输入密码,直接回车即可
Stoping MySQL...
Enter password:
[[email protected] mysql]# ss -ntl | grep 330*    #可以看到是关闭了的
LISTEN     0      80          :::3307                    :::*
LISTEN     0      80          :::3308                    :::*  

#修改数据库登录密码,注意,需要启动后执行下面命令
[[email protected] mysql]# mysqladmin -S /mysql/3307/socket/mysql.sock password ‘centos‘
#以下已将密码修改为centos,记得还要改下启动脚本中的mysql_pwd的值
[[email protected] mysql]# vim /mysql/3307/bin/mysqld
[[email protected] mysql]# grep ‘^mysql_pwd‘ /mysql/3307/bin/mysqld
mysql_pwd="centos"
[[email protected] mysql]# /mysql/3307/bin/mysqld stop
#有密码后,关闭进不提示输密码了
Stoping MySQL...
[[email protected] mysql]# ss -ntl | grep 330*  #可以看到3307已经关闭了
LISTEN     0      80          :::3308                    :::*                  

原文地址:https://www.cnblogs.com/hovin/p/11956679.html

时间: 2024-10-03 23:04:30

Linux学习-基于CentOS7的MariaDB数据库的安装的相关文章

Linux学习-基于CentOS7的MariaDB数据库的主从复制

一.MySQL主从复制原理 主从同步过程中主服务器有一个工作线程I/O dump thread,从服务器有两个工作线程I/O thread和SQL thread: 主服务器: dump Thread:为每个Slave的I/O Thread启动一个dump线程,用于向其发送binary log events: 从服务器: I/O Thread:向Master请求二进制日志事件,并保存于中继日志中: SQL Thread:从中继日志中读取日志事件,在本地完成重放. 主库把外界接收的SQL请求记录到自

Linux学习-基于CentOS7的ProxySQL实现读写分离

一.实验环境 主机:3台,一台ProxySQL(192.168.214.37),两台主从复制,master(192.168.214.17),slave(192.168.214.27) 系统:CentOS7.6 数据库:mariadb-server-5.5.60(光盘yum源) ProxySQL:proxysql-1.4.16 ProxySQL组成 服务脚本:/etc/init.d/proxysql 配置文件:/etc/proxysql.cnf 主程序:/usr/bin/proxysql 基于SQ

Linux学习-基于CentOS7的LAMP环境实现多虚拟主机

一.实验环境 系统:CentOS7.6 主机:两台(一台也可以),一台实现apache+php-fpm (192.168.214.17),一台实现mysql服务器 (192.168.214.27) 软件包: Apache:httpd-2.4.39.tar.bz2,apr-1.7.0.tar.bz2,apr-util-1.6.1.tar.bz2 PHP:php-7.3.7.tar.xz MySQL:mariadb-10.2.25-linux-x86_64.tar.gz (二进制包) web网站:D

centos7之mariadb数据库的安装

1.安装mariadb软件包 #yum -y install mariadb mariadb-server #rpm -qa | grep mariadb 查看安装的mariadb数据库软件包 2.启动数据库服务 #systemctl start mariadb 3.运行数据库安全设置(必须先启动数据库才能运行这一步) #mysql_secure_installation 运行之后会有以下几个设置 初次运行直接回车a)为root用户设置密码b)删除匿名账号c)取消root用户远程登录d)删除te

【Linux学习之旅】之Ubuntu14.04安装及美化之后要做的事

以上是我的Ubuntu里安装的一些软件. 1)卸载不需要的软件,在启动器里右键单击要卸载的软件即可. 2)升级你的软件版本 sudo apt-get update && sudo apt-get upgrade 3)安装Fcitx sudo apt-get install fcitx fcitx-googlepinyin 4) 安装samba samba服务器安装后,就可以与你所在的网络中的其他用户共享文件了. sudo apt-get install samba 5)安装媒体工具 sud

基于centos7搭建MySQL数据库

本文包括mysql服务的安装配置,和简单的使用,还包括了对mysql用户账号的授权管理,前部分为安装,后面一半为用户授权管理及简单使用(增删改查): 一.安装配置MySQL数据库: 为了确保MySQL数据库功能的完整性.可定制性,我采用了源代码编译安装的方式安装MySQL数据库系统,MySQL5.X系列版本的使用最为广泛,该版本的稳定性.兼容性都不错,下载源码包的官方站点为https://www.mysql.com . 现在MySQL已经被甲骨文公司收购了,而且甲骨文公司有意将MySQL发展为一

CentOS7下MariaDB数据库安装及配置

前言 MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品.在存储引擎方面,使用XtraDB来代替MySQL的InnoDB. MariaDB由MySQL的创始人Michael Widenius主导开发,MariaDB名称来自Michael Widenius的女儿Maria的名字 Linux安装MariaDB 安装 使用yum安装MariaDB yum insta

Mac中MariaDB数据库的安装步骤

前言 MariaDB由MySQL的创始人Michael Widenius主导开发,他早前曾以10亿美元的价格,将自己创建的公司MySQL卖给了SUN,此后,随着SUN被甲骨文收购,MySQL的所有权也落入Oracle的手中.MariaDB名称来自Michael Widenius的女儿Maria的名字.那么在Mac中如何安装MariaDB数据库呢?下面小编就给大家介绍Mac中安装配置MariaDB数据库的方法. MariaDB安装步骤 如果你是Mac上的开发者,通过本文你可以在OS X上通过Hom

脚本实现二进制MariaDB数据库的安装

一.实验目的 mariadb属于关系型数据库,通过此实验掌握mariadb数据库的二进制安装 二.实验准备 mariadb-10.2.23-linux-x86_64.tar.gz安装包,虚拟机需要安装expect包 三.实验脚本 vim /data/mysql.sh #!/bin/bash #create group user 创建用于mysql服务的组和用户 groupadd -r -g 336 mysql #创建mysql组,系统组,gid336 useradd -r -g mysql -u