热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CentOS6.5系统安装MariaDB数据库详细步骤

1、软件环境:CentOS6.5x64MariaDB5.5.362、安装过程1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下:#MariaDB5.5CentOSrepositorylist-created2014-03-0411:20UTC#http://mariadb.org/m
 1、软件环境: CentOS 6.5 x64
MariaDB 5.5.36
2、安装过程 1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下:
# MariaDB 5.5 CentOS repository list - created 2014-03-04 11:20 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
2)在Shell环境下执行命令
# yum install MariaDB-server MariaDB-client
Loaded plugins: fastestmirror, security
base                                                                                       | 3.7 kB     00:00
base/primary_db                                                                            | 4.4 MB     01:11
extras                                                                                     | 3.4 kB     00:00
extras/primary_db                                                                          |  19 kB     00:00
mariadb                                                                                    | 1.9 kB     00:00
mariadb/primary_db                                                                         |  15 kB     00:00
updates                                                                                    | 3.4 kB     00:00
updates/primary_db                                                                         | 2.1 MB     00:22
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:5.5.36-1.el6 will be obsoleting
--> Processing Dependency: MariaDB-common for package: MariaDB-client-5.5.36-1.el6.x86_64
---> Package MariaDB-server.x86_64 0:5.5.36-1.el6 will be obsoleting
---> Package mysql.x86_64 0:5.1.71-1.el6 will be obsoleted
---> Package mysql-server.x86_64 0:5.1.71-1.el6 will be obsoleted
--> Running transaction check
---> Package MariaDB-common.x86_64 0:5.5.36-1.el6 will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-5.5.36-1.el6.x86_64
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:5.5.36-1.el6 will be obsoleting
---> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be obsoleted
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================
 Package                        Arch                   Version                      Repository               Size
==================================================================================================================
Installing:
 MariaDB-client                 x86_64                 5.5.36-1.el6                 mariadb                  10 M
     replacing  mysql.x86_64 5.1.71-1.el6
 MariaDB-compat                 x86_64                 5.5.36-1.el6                 mariadb                 2.7 M
     replacing  mysql-libs.x86_64 5.1.71-1.el6
 MariaDB-server                 x86_64                 5.5.36-1.el6                 mariadb                  42 M
     replacing  mysql-server.x86_64 5.1.71-1.el6
Installing for dependencies:
 MariaDB-common                 x86_64                 5.5.36-1.el6                 mariadb                  23 k
Transaction Summary
==================================================================================================================
Install       4 Package(s)
Total download size: 55 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): MariaDB-5.5.36-centos6-x86_64-client.rpm                                            |  10 MB     04:45
(2/4): MariaDB-5.5.36-centos6-x86_64-common.rpm                                            |  23 kB     00:00
(3/4): MariaDB-5.5.36-centos6-x86_64-compat.rpm                                            | 2.7 MB     01:02
(4/4): MariaDB-5.5.36-centos6-x86_64-server.rpm                                            |  42 MB     17:44
------------------------------------------------------------------------------------------------------------------
Total                                                                              40 kB/s |  55 MB     23:34
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
Retrieving key from https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Importing GPG key 0x1BB943DB:
 Userid: "Daniel Bartholomew (Monty Program signing key) "
 From  : https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : MariaDB-compat-5.5.36-1.el6.x86_64                                                             1/7
  Installing : MariaDB-common-5.5.36-1.el6.x86_64                                                             2/7
Error in PREIN scriptlet in rpm package MariaDB-server-5.5.36-1.el6.x86_64
******************************************************************
A MySQL or MariaDB server package (mysql-server-5.1.71-1.el6.x86_64) is installed.
The current MariaDB server package is provided by a different
vendor (CentOS) than Monty Program AB.  Some files may be installed
to different locations, including log files and the service
startup script in /etc/init.d/.
Upgrading directly from MySQL 5.1 to MariaDB 5.5 may not
be safe in all cases.  A manual dump and restore using mysqldump is
recommended.  It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.
A manual upgrade is required.
- Ensure that you have a complete, working backup of your data and my.cnf
  files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages.  Usually this command will
  list the packages you should remove:
  rpm -qa | grep -i '^mysql-'
  You may choose to use 'rpm --nodeps -ev ' to remove
  the package which contains the mysqlclient shared library.  The
  library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by Monty Program AB
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program
This is a brief description of the upgrade process.  Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-5.5.36-1.el6.x86_64) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping MariaDB-server-5.5.36-1.el6
  Installing : MariaDB-client-5.5.36-1.el6.x86_64                                                             4/7
  Erasing    : mysql-5.1.71-1.el6.x86_64                                                                      5/7
  Erasing    : mysql-libs-5.1.71-1.el6.x86_64                                                                 6/7
  Verifying  : MariaDB-common-5.5.36-1.el6.x86_64                                                             1/7
  Verifying  : MariaDB-compat-5.5.36-1.el6.x86_64                                                             2/7
  Verifying  : MariaDB-client-5.5.36-1.el6.x86_64                                                             3/7
  Verifying  : mysql-libs-5.1.71-1.el6.x86_64                                                                 4/7
  Verifying  : MariaDB-server-5.5.36-1.el6.x86_64                                                             5/7
mysql-server-5.1.71-1.el6.x86_64 was supposed to be removed but is not!
  Verifying  : mysql-server-5.1.71-1.el6.x86_64                                                               6/7
  Verifying  : mysql-5.1.71-1.el6.x86_64                                                                      7/7
Installed:
  MariaDB-client.x86_64 0:5.5.36-1.el6                    MariaDB-compat.x86_64 0:5.5.36-1.el6
Dependency Installed:
  MariaDB-common.x86_64 0:5.5.36-1.el6
Replaced:
  mysql.x86_64 0:5.1.71-1.el6                           mysql-libs.x86_64 0:5.1.71-1.el6
Failed:
  MariaDB-server.x86_64 0:5.5.36-1.el6                     mysql-server.x86_64 0:5.1.71-1.el6
Complete!
3、启动MariaDB
# /etc/init.d/mysqld start
Initializing MySQL database:  WARNING: The host 'Cloud-Q2' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
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 MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h Cloud-Q2 password 'new-password'
Alternatively you can run:
/usr/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 manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
4、为MariaDB设置密码
# /usr/bin/mysqladmin -u root password 'adminadmin'
登陆MariaDB
MySQL [(none)]> use mysql;
MySQL [mysql]> update user set host='%' where user='root' and host='127.0.0.1';
MySQL [mysql]> grant all privileges on *.* to 'root'@'%' identified by 'adminadmin' with grant option;
MySQL [mysql]> flush privileges;
5、让防火墙通过3306端口
# vi /etc/sysconfig/iptables
添加如下内容:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
保存并退出编辑
重启防火墙服务
# service iptables restart
远程连接检查,一切OK!
推荐阅读
  • MySQL5.6.40在CentOS764下安装过程 ... [详细]
  • 阿里云主机实战应用之centos7上的防火墙设置
    最近公司又上了一台服务器,以前都是用centos6系统,这次选择使用了centos7系统的安装镜像,因为现在程序版本在centos7上一般php默认就是5.4以上的,mysql也 ... [详细]
  • 1.ATP方式安装在ubuntu系统的apt软件仓库中,默认存在MySQL数据库,所以直接使用apt命令就可以安装。使用命令:aptapt-getin ... [详细]
  • centos7如何利用yum安装mysql 8.0.12
    这篇文章将为大家详细讲解有关centos7如何利用yum安装mysql8.0.12,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有 ... [详细]
  • 篇首语:本文由编程笔记#小编为大家整理,主要介绍了CentOS7编译mysql8.0.12相关的知识,希望对你有一定的参考价值。步骤一:安装 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • centos安装Mysql的方法及步骤详解
    本文介绍了centos安装Mysql的两种方式:rpm方式和绿色方式安装,详细介绍了安装所需的软件包以及安装过程中的注意事项,包括检查是否安装成功的方法。通过本文,读者可以了解到在centos系统上如何正确安装Mysql。 ... [详细]
  • mysql5.6 多实例 主从安装_MySQL5.6一主多从的半同步复制实例
    半同步简介:在默认情况下,MySQL的复制是异步的,这意味着主服务器及其从服务器是独立的。异步复制可以提供最佳的性能,因为主服务器在将更新 ... [详细]
  • Centos7安装MySql5.6
    如何在CentO ... [详细]
  • MySQL/MariaDB/PerconaDB提权条件漏洞
    背景  2016年11月01日,国外安全研究员DawidGolunski在MyS ... [详细]
  • 本文是搭建的mariadb-10.0.17版本的下载地址:https:downloads.mariadb.orginterstitialmariadb-10.0.17sourcemariadb-10.0.17.tar.gzfromhtt ... [详细]
  • 如何部署Zabbix监控实现监测和报警机制
    这篇文章的知识点包括:Zabbix的安装部署、Zabbix监控的实现以及Zabbix报警机制的实现,阅读完整文相信大家对Zabbix监控的使用有了一定的认识。Zabb ... [详细]
  • Centos下安装memcached+memcached教程
    本文介绍了在Centos下安装memcached和使用memcached的教程,详细解释了memcached的工作原理,包括缓存数据和对象、减少数据库读取次数、提高网站速度等。同时,还对memcached的快速和高效率进行了解释,与传统的文件型数据库相比,memcached作为一个内存型数据库,具有更高的读取速度。 ... [详细]
  • mysql数据库生成表插件_screw 数据库文档生成工具
    简洁好用的数据库表结构文档工具在企业级开发中、我们经常会有编写数据库表结构文档的时间付出,从业以来,待过几家企业,关于数据库表结构文档状态:要么没有、要么有、但都是手写 ... [详细]
author-avatar
落叶听声
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有