⑴ 安装mariadb需哪些rpm包
大部分linux版本的MariaDB软件是以RPM包的形式发布的。RPM包的安装和卸载都很方便,通过简单的命令就可以实现,安装后可以通过手动修改配置文件的方式进行配置。本节将介绍MariaDB的RPM包的安装和配置。
首先必须到MariaDB官方网站下载对应的RPM包,在该网站上有很多种类的RPM安装包,读者必须根据自己的操作系统和处理器类型来选择。本书选择rhel6-x86来安装,如图3.1所示。单击rhel6-x86这个链接,可以进入如图3.2所示的网页。
在该界面选择rpms,将显示如图3.3所示的页面。
从图3.3可以看出,这下面包括Server、Client和Shared等多个RPM包。其中,Server的RPM包是安装MariaDB服务的,Client的RPM包是安装MariaDB客户端的。通常安装这两个包就可以了,因此就下载并安装这两个RPM包。Server软件包为MariaDB-5.5.33a-centos6-i686-server.rpm。Client软件包为MariaDB-5.5.33a-centos6-i686- client.rpm。假设将这两个RPM包下载到download文件夹下。下面可以安装MariaDB的Server软件和Client软件了,具体步骤如下所述。
(1)登录到root用户,并将RPM包复制到/usr/local/src/文件夹下。登录到root用户的命令如下:
shell>su root
输入命令并按回车键后,系统会提示输入密码。密码输入正确后,就可以登录到root用户下。然后执行cp命令将RPM包复制到/usr/local/src/文件夹下。命令如下:
shell>cp download_path/MariaDB-5.5.33a-centos6-i686-server.rpm /usr/local/src/ shell>cp download_path/MariaDB-5.5.33a-centos6-i686-client.rpm /usr/local/src/
上面的第一条命令是将MariaDB的RPM包复制到/usr/local/src文件夹下。download_path是RPM包下载后放置的路径。这些代码执行如下:
[hjh@localhost download]$ su root password: [root@localhost download]# cp ./MariaDB-5.5.33a-centos6-i686-server.rpm /usr/local/src/ [root@localhost download]# cp ./MariaDB-5.5.33a-centos6-i686-client.rpm /usr/local/src/
用root用户登录成功后,系统从用户hjh切换到root用户。因为这两个RPM包就存储在download目录下,所以用“.”表示当前目录。
说明:在Linux操作系统下安装MariaDB时,一定要注意权限问题。安装RPM软件包时,需要使用root权限。如果没有root权限,安装时会提示权限不够的信息。安装完成后,需要使用root权限启动和关闭MariaDB服务。
(2)切换到/usr/local/src目录下,然后安装MariaDB数据库。RPM软件包使用命令rpm进行安装。代码如下:
shell>cd /usr/local/src/ shell> rpm -ivh MariaDB-5.5.33a-centos6-i686-server.rpm shell> rpm -ivh MariaDB-5.5.33a-centos6-i686-client.rpm
⑵ 如何安装mariadb-galera-5.5.56-linux-x86
转载 一 安装 下载mariaDB MariaDB-5.5.29-rhel5-x86_64-common.rpm 和MariaDB-5.5.29-rhel5-x86_64-server.rpm 包,MariaDB-5.5.29-rhel5-x86_64-client.rpm 2.然后再http.//yum。mariadb。org/ 找到 RPM-GPG-KEY-MariaDB 这个PGP文件
⑶ Linux怎么查看软件安装路径 查看mysql安装在哪
不同的linux版本查看mysql安装路径的方法略有不同,这里以debian系列的linux发行版和redhat系列的linux发行版为例,简要说明其查询方法,仅供参考。
一、redhat系列的查询方法
1、查询mysql服务端安装的路径。
rpm-qlmariadb-server
或者
rpm-qlmysql-server
说明:mysql被oracle收购了,现在开源版本为mariadb,rpm是redhat系列
linux发行版本的包管理程序,-ql是其参数,-q是查询,-l是列出安装文件。
后面接的是mysql的服务端。
⑷ 如何在 CentOS 7 上安装和安全配置 MariaDB 10
MariaDB数据库管理系统相比于Mysql数据库管理系统有了很多新鲜的扩展特性,例如对微秒级别的支持、线程池、子查询优化、进程报告等等技术,决定学习MariaDB数据库管理系统绝对是一个非常正确的选择。配置妥当Yum软件仓库后即可开始安装部署MariaDB数据库主程序及服务端程序了
这篇文章是在CENTOS 7的母版RHEL 7的版本,两者几乎没有区别,版本都是一致的。我觉得就是你想要的。
#第18章使用MariaDB数据库管理系统。
#linuxprobe.com/chapter-18.html
[root@linuxprobe~]#yuminstallmariadbmariadb-server
Loadedplugins:langpacks,proct-id,subscription-manager
………………省略部分输出信息………………
Installing:
mariadbx86_641:5.5.35-3.el7rhel8.9M
mariadb-serverx86_641:5.5.35-3.el7rhel11M
Installingfordependencies:
perl-Compress-Raw-Bzip2x86_642.061-3.el7rhel32k
perl-Compress-Raw-Zlibx86_641:2.061-4.el7rhel57k
perl-DBD-MySQLx86_644.023-5.el7rhel140k
perl-DBIx86_641.627-4.el7rhel802k
perl-Data-Dumperx86_642.145-3.el7rhel47k
perl-IO-Compressnoarch2.061-2.el7rhel260k
perl-Net-Daemonnoarch0.48-5.el7rhel51k
perl-PlRPCnoarch0.2020-14.el7rhel36k
TransactionSummary
⑸ 如何在linux上面安装mariadb总结
一 安装
1.需要下载 perl-DBI-1.521-1.EL5.rfx.x86_64.rpm 安装包,
mariaDB MariaDB-5.5.29-rhel5-x86_64-common.rpm
MariaDB-5.5.29-rhel5-x86_64-server.rpm
MariaDB-5.5.29-rhel5-x86_64-client.rpm
2.然后再http://yum.mariadb.org/ 找到 RPM-GPG-KEY-MariaDB 这个PGP文件,
把文件放入到/etc/pki/rpm-gpg 目录下,执行 导入key 的命令 rpm --import /etc/pki/rpm-gpg/RPM*
3.安装perl-DBI-1.521-1.EL5.rfx.x86_64.rpm 包, rpm -ivh perl-DBI-1.521-1.EL5.rfx.x86_64.rpm
4.安装MariaDB 包 ,rpm -ivh MariaDB-*,安装完成
二,使用
1.启动mysql:
[root@localhost mysql]# service mysql start
Starting MySQL....... [ OK ]
2.进入mysql # mysql -u root -p
[root@localhost rpms]# mysql
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (5.75 sec)
⑹ mariadb安装后存在centos7哪个目录下
一, CentOS7环境下
1. 安装Mysql5.6.19,安装成功后,端口号:3306
[root@centOS7]# mysql -uroot -h127.0.0.1 -P3306 -p
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.19 |
+-----------+
1 row in set (0.00 sec)
2.安装MariaDB10.0.12.,安装成功后,口端口号:3307
[root@centOS7]# mysql -uroot -h127.0.0.1 -P3307 -p
mysql> select version();
+---------------------+
| version() |
+---------------------+
| 10.0.12-MariaDB-log |
+---------------------+
1 row in set (0.00 sec)
下面是,在Mysql安装好后,安装MariaDB10.0.12的详细方法
下载最新版本的二进制编译包tar.gz (目前为mariadb-10.0.12-linux-x86_64),并将它解压到你的自定义目录中. 本文档假定安装目录为/opt.
创建数据所在目录及符号链接,如下所示:
[root@centOS7 opt]# mkdir mariadb-data
[root@centOS7 opt]# ln -s mariadb-10.0.12-linux-x86_64 mariadb
[root@centOS7 opt]# ls -al
total 20
drwxr-xr-x. 5 root root 4096 2014-09-26 07:27 .
dr-xr-xr-x. 23 root root 4096 2014-09-26 06:38 ..
lrwxrwxrwx. 1 root root 27 2014-09-26 07:27 mariadb -> mariadb-10.0.12-linux-x86_64
drwxr-xr-x. 13 root root 4096 2014-09-26 07:07 mariadb-10.0.12-linux-x86_64
drwxr-xr-x. 2 root root 4096 2014-09-26 07:26 mariadb-data
创建组mariadb及用户mariadb, 设置文件对应的所属权限:
[root@centOS7 opt]# groupadd --system mariadb
[root@centOS7 opt]# useradd -c "MariaDB Server" -d /opt/mariadb -g mariadb --system mariadb
[root@centOS7 opt]# chown -R mariadb:mariadb mariadb-10.0.12-linux-x86_64/
[root@centOS7 opt]# chown -R mariadb:mariadb mariadb-data/
通过从support-files中拷贝my.cnf, 在/opt/mariadb目录下创建新的my.cnf:
[root@centOS7 opt]# cp mariadb/support-files/my-medium.cnf mariadb-data/my.cnf
[root@centOS7 opt]# chown mariadb:mariadb mariadb-data/my.cnf
编辑文件/opt/mariadb-data/my.cnf, 增加自定义值, socket, port, user及最重要的设置: data目录和base目录. 最后的设置至少是这样的:
[client]
port = 3307
socket = /opt/mariadb-data/mariadb.sock
[mysqld]
datadir = /opt/mariadb-data
basedir = /opt/mariadb
port = 3307
socket = /opt/mariadb-data/mariadb.sock
user = mariadb
从support-files文件中拷贝init.d脚本到对应的位置:
[root@centOS7 opt]# cp mariadb/support-files/mysql.server /etc/init.d/mariadb
[root@centOS7 opt]# chmod +x /etc/init.d/mariadb
编辑/etc/init.d/mariadb,使用 mariadb替换 mysql设置项, 如下所示:
- # Provides: mysql
+ # Provides: mariadb
- basedir=
+ basedir=/opt/mariadb
- datadir=
+ datadir=/opt/mariadb-data
- lock_file_path="$lockdir/mysql"
+ lock_file_path="$lockdir/mariadb"
你需要告诉mariadb读取唯一的cnf文件. 在$bindir/mysqld_safe之后加上--defaults-file=/opt/mariadb-data/my.cnf. 最后参数设置应该是这样的:
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
$bindir/mysqld_safe --defaults-file=/opt/mariadb-data/my.cnf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
显式指定 my.cnf作为传入参数,来运行 mysql_install_db:
[root@centOS7 opt]# cd mariadb
[root@centOS7 mariadb]# scripts/mysql_install_db --defaults-file=/opt/mariadb-data/my.cnf
现在你可以这样启动MariaDB:
[root@centOS7 opt]# /etc/init.d/mariadb start
Starting MySQL SUCCESS
把MariaDB启动设置为系统级别启动:
[root@centOS7 opt]# cd /etc/init.d
[root@centOS7 init.d]# chkconfig --add mariadb
[root@centOS7 init.d]# chkconfig --levels 3 mariadb on
最后,测试现在有两个数据库服务实例在运行:
[root@centOS7 ~]# mysql -e "SELECT VERSION();"
+-----------+
| VERSION() |
+-----------+
| 5.6.19 |
+-----------+
[root@mariadb-near-mysql ~]# mysql -e "SELECT VERSION();" --socket=/opt/mariadb-data/mariadb.sock
+--------------------+
| VERSION() |
+--------------------+
|10.0.12-MariaDB-log |
+--------------------+
⑺ 如何在Ubuntu 14.04 LTS上安装MariaDB
要安装MariaDB,我们首先要设置MariaDB仓库。
设置 MariaDB 仓库
从命令行连接到MariaDB :
linuxtechi@mail:~$ mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 40
Server version: 10.0.14-MariaDB-1~trusty-log mariadb.org binary distribution
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]>
MariaDB 服务
$ sudo /etc/init.d/mysql stop$ sudo /etc/init.d/mysql start
⑻ 如何安装MYSQL
使用yum安装mysql数据库的软件包 [root@xuegod63 ~]# yum -y install mariadb-server mariadb 。
注: mariadb-server #MariaDB数据库 mariadb # MariaDB服务器Linux下客户端 。
注:从centos7系统开始,系统中自带的mysql数据库变成了mariadb-server,mariadb-server和mysql操作上一样。mariadb-server是mysql的一个分支。
启动数据库服务[root@xuegod63 ~]# systemctl start mariadb #启动MariaDB服务。[root@xuegod63 ~]# systemctl enable mariadb #设置开启自动启动MariaDB服务。
安装完mariadb-server后,运行mysql_secure_installation去除安全隐患,[root@xuegod63 ~]# mysql_secure_installation #进入安全配置导向。
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQLSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current,password for the root user. If you've just installed MySQL, 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): #初次运行直接回车,因为root用户没有密码。
OK, successfully used password, moving on,Setting the root password ensures that nobody can log into the MySQL,root user without the proper authorisation.,Set root password? [Y/n] Y #是否设置root用户密码,输入Y。
New password: 123456 #新密码123456,Re-enter new password: 123456,Password updated successfully!Remove anonymous users? [Y/n] Y #是否删除匿名用户,生产环境建议删除,所以直接回车或Y。
Success!Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] Y #是否禁止root远程登录,根据自己的需求选择Y/n并回车建议禁止。
Success!By default, MariaDB comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a proction environment.Remove test database and access to it? [Y/n] Y #是否删除test数据库,直接回车或Y。
⑼ linux中怎么修改mariadb的配置
这叫做局部复制。复制过程不仅仅是复制一个数据库,同时也包括从主节点到一个从节点的更改同步。但这并不意味着从数据库就是和主数据库完全相同的副本,因为复制可以配置为只复制表结构、行或者列这是一个创建数据库重复版本的过程
⑽ 怎么在linux上安装mysql
Mysql被Oracle收购了以后,有闭源的风险,所以现在已经用mariaDB代替Mysql(其实都是一个东西,就和RHEL和Centos差不多)了,安装方法如下:
安装MariaDB
CentOS 7.0中,已经使用MariaDB替代了MySQL数据库
1、安装MariaDB
yum install mariadb mariadb-server #询问是否要安装,输入Y即可自动安装,直到安装完成
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷贝配置文件(注意:如果/etc目录下面默认有一个my.cnf,直接覆盖即可)
2、为root账户设置密码
mysql_secure_installation
回车,根据提示输入Y
输入2次密码,回车
根据提示一路输入Y
最后出现:Thanks for using MySQL!
MySql密码设置完成,重新启动 MySQL:
systemctl restart mariadb.service #重启MariaDB