centos7 mysql安装
一、系统环境
[root@localhost home]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
二、mysql安装
安装mysql和mysql-devel都成功,但是安装mysql-server失败,如下:
[root@localhost home]# yum install mysql-server
已加载插件:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): base/7/x86_64/group_gz | 155 kB 00:00:01
(2/4): extras/7/x86_64/primary_db | 139 kB 00:00:01
(3/4): base/7/x86_64/primary_db | 5.6 MB 00:00:38
(4/4): updates/7/x86_64/primary_db | 4.7 MB 00:00:39
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
没有可用软件包 mysql-server。
错误:无须任何处理
出现这样问题是CentOS 7 版本将MySQL数据库软件从默认的程序列表中移除,用mariadb代替了
有两种解决办法:
1、方法一:安装mariadb
MariaDB数据库管理系统是MySQL的一个分支,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。MariaDB由MySQL的创始人Michael Widenius(英语:Michael Widenius)主导开发,他早前将自己创建的公司MySQL AB卖给了SUN,此后,随着SUN被甲骨文收购,MySQL的所有权也落入Oracle的手中。MariaDB名称来自Michael Widenius的女儿Maria的名字。
安装mariadb,输入安装命令
[root@localhost home]# yum install mariadb-server mariadb
mariadb数据库的相关命令是:
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动
先启动数据库
[root@yl-web yl]# systemctl start mariadb
默认无密码
[root@localhost lzh]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 5.5.52-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
2、方法二:官网下载安装mysql-server
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
安装成功后重启mysql服务
# service mysqld restart
初次安装mysql,root账户没有密码
[root@localhost lzh]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.26 MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
设置密码
mysql> set password for 'root'@'localhost' =password('password');
Query OK, 0 rows affected (0.00 sec)
安装完以后mariadb自动就被替换了,将不再生效。
[root@localhost lzh]# rpm -qa |grep mariadb
centos7 mysql安装的更多相关文章
- CENTOS7 mysql 安装
CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1. 下载mysql的repo源 $ wget http://repo.mysql.com ...
- [mysqld_safe]centos7 mysql 安装与配置
查资料发现是CentOS 7 版本将MySQL数据库软件从默认的程序列表中移除,用mariadb代替了. 有两种解决办法: 安装mariadb [root@a ~]# yum install mar ...
- centos7 mysql安装与用户设置
1.环境:Centos 7.0 64位2.mysql版本:5.73.安装:https://dev.mysql.com/doc/refman/5.7/en/installing.html3.1.创建my ...
- CentOS7 Hive 安装
hive的安装模式有2种,一种是使用自带的derby数据库,另一种是使用mysql作为元数据库.derby方式一般没人用,因为它是单用户模式.这里主要讲解mysql方式. hive仅仅是一个客户端工具 ...
- CentOS7下一个mysql安装
CentOS7安装MySQL --下载mysql http://mirrors.sohu.com/mysql/MySQL-5.6/ http://mirrors.sohu.com/mysql/MySQ ...
- 阿里云CentOS-7.2安装mysql
我下载的阿里云的服务器系统centos7.2是纯内核版本,并没有其他的工具,所以这个系统是非常干净的.所以我就需要给系统安装一一些工具,来方便系统的管理与操作,我们上面讲到了关于服务器的yum的配置在 ...
- CentOS7下安装MySQL并配置远程连接
一.CentOS7下安装MySQL数据库 CentOS7默认的安装包里面已经没有 MySQL-Server安装包了,远程镜像中也没有了. 默认的是MariaDB (MySQL的一个分支,开发这个分支的 ...
- CentOS7.4安装MySQL踩坑记录
CentOS7.4安装MySQL踩坑记录 time: 2018.3.19 CentOS7.4安装MySQL时网上的文档虽然多但是不靠谱的也多, 可能因为版本与时间的问题, 所以记录下自己踩坑的过程, ...
- linux centos7下mysql安装--韩国庆
首先我先给大家介绍下MariaDB和mysql的区别. 上图,“MySQL之父”的骨灰级程序员Monty,但是mysql被Oracle收购后,Monty又开始去发展另一条数据库的道路,并且以Monty ...
随机推荐
- Using PL/SQL APIs as Web Services
Overview Oracle E-Business Suite Integrated SOA Gateway allows you to use PL/SQL application program ...
- 非阻塞IO模式原理
与阻塞模式对应的另一种模式叫非阻塞IO模式,在整个通信过程中读和写操作不会阻塞,当前处理线程不存在阻塞情况.从A机器到B机器它的通信过程是:A机器一条线程将通道设置为写事件后往下执行,而另外一条线程遍 ...
- 【面试笔试算法】Problem 8: 然而沼跃鱼早就看穿了一切(hiho题库)
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句子中的沼跃鱼("marshtom ...
- android TextView 垂直自动滚动字幕实现
参考网上一些做法然后进行了修改, 首先继承TextView /** * VerticalScrollTextView.java * 版权所有(C) 2013 * 创建者:cuiran 2013-12- ...
- 【Python】模拟radius coa报文
Radius协议中网关设备NAS是client,实现radius协议的服务为服务端(例如freeradius),这种情况下radius server并不能主动给NAS发送信息.在 rfc3576 Dy ...
- java基础Haep(堆)和Stack(栈)区别
简单的可以理解为: heap:是由malloc之类函数分配的空间所在地.地址是由低向高增长的. stack:是自动分配变量,以及函数调用的时候所使用的一些空间.地址是由高向低减少的. 注:何为高地址 ...
- “万能数据库查询分析器” 5.03发布,访问EXCEL将自动为表名前后加上中括弧
"万能数据库查询分析器" 5.03发布,访问EXCEL将自动为表名前后加上中括弧 1 引言 中国本土程序员马根峰推出的个人作品----万能数据库查询 ...
- remove Nth Node from linked list从链表中删除倒数第n个元素
Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...
- Spring对事务管理的支持的发展历程(基础篇)
1.问题 Connection conn = DataSourceUtils.getConnection(); //开启事务 conn.setAutoCommit(false); try { Obje ...
- SQL遇到的问题
1.问题描述:拼接sql字符串涉及到表变量时报错. 解决办法:把表变量的定义一同放在字符串中. 2.问题描述:EF添加实体后,调用存储过程调用不到 解决办法:必须先db.SaveChanges()后 ...