centOS7 安装mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar

在虚拟机上安装mysql走了不少弯路,在此备份。。。

首先感谢下这几篇博客提供的帮助:

https://www.cnblogs.com/pythonal/p/6141516.html

http://blog.csdn.net/typa01_kk/article/details/49059729

http://blog.csdn.net/skywalker_leo/article/details/47274441

1.官网下载mysql:

mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar

mysql分了好多版本,有linux和ubuntu等等的,个人感觉最方便的是红帽;

2.解压:

tar -xvf mysql-版本号

解压后有很多个,但是我们只需要安装4个(有项目依赖,需要关注下顺序);

3.安装:

安装前先卸载自带的mariadb-lib(必须卸载,不然会碰到依赖错误,别问我怎么知道的。。。)

备注:如果删不掉的话可以试试这条命令:yum remove mysql-libs

然后依次安装:

  #rpm -ivh mysql-community-common-版本.el6.x86_64.rpm

  #rpm -ivh mysql-community-libs-版本.el6.x86_64.rpm

  #rpm -ivh mysql-community-client-版本.el6.x86_64.rpm

  #rpm -ivh mysql-community-server-版本.el6.x86_64.rpm

4.数据库初始化:

为了保证数据库目录为与文件的所有者为 mysql 登陆用户,如果你是以 root 身份运行 mysql 服务,需要执行下面的命令初始化mysqld --initialize --user=mysql

systemctl start mysqld.service

mysql -uroot -p第一次不用输入密码直接登录,如果输入密码了或者碰到如下错误:

Access denied for user ‘root‘@‘localhost‘ (using password:YES)

请参考这篇博客解决:

http://blog.csdn.net/skywalker_leo/article/details/47274441;

[[email protected] ~]# mysql -uroot -proot123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19538
Server version: 5.7.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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>
修改之后登录成功,可能需要重置密码;

以上;



原文地址:https://www.cnblogs.com/wsh1230/p/8119526.html

时间: 2024-08-01 00:25:41

centOS7 安装mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar的相关文章

centos7安装mysql和mysql-connector-c++

最近为了搭建自己的开发环境,又一次在centos7上面开始安装mysql和c++的访问环境,特此记录一下搭建过程,方便以后查阅 一.安装mysql centos7 默认安装了mariaDB,导致不能安装mysql,要安装msyql首先得卸载mariaDB 1.卸载mariaDB (1)执行命令:rpm -qa | grep mariadb 查询已安装的mariaDB相关软件包 例如: mariadb-devel-5.5.52-1.el7.x86_64 mariadb-5.5.52-1.el7.x

centos7安装mysql(MariaDB)

1.centos7现状: 新系统无法再使用yum install mysql-server来安装mysql,因为已使用mariadb代替mysql. 2.安装mariadb: [[email protected] ~]# yum -y install mariadb* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.linode.com * extras: mirro

CentOS7 安装 MySQL 5.7.10

卸载冲突的rpm包:rpm -qa|grep mariadbrpm -e --nodeps mariadb-libs-5.5.41-2.el7_0.x86_64 安装:rmp -ivh mysql-community-common-5.7.10-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-5.7.10-1.el7.x86_64.rpmrpm -ivh mysql-community-devel-5.7.10-1.el7.x86_64.rpmrpm

阿里云centos7安装mysql 5.7.29

1.下载,进入mysql官网,查找需要的版本: wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-server-5.7.29-1.el7.x86_64.rpm 2.安装mysql包 rpm -ivh mysql-community-server-5.7.29-1.el7.x86_64.rpm 报如下图错误,提示依赖mysql-community-client,mysql-community-common-5.7.

CentOS7 安装mysql(YUM方式)

1.下载mysql源安装包 shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm 2.安装mysql源 shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm 3.检查mysql源是否安装成功 shell> yum repolist enabled | grep "mysql.*-communit

rpm -ivh vsftpd-3.0.2-22.el7.x86_64.rpm出现error: open of vsftpd-3.0.2-22.el7.x86_64.rpm failed: No such file or directory的解决方法

情况一: 出现如图问题, 我当时的问题是通过安装rpmbuild工具软件解决的 以前制作rpm时,没有遇到过这个问题,几经搜索也没有解决.后来发现当前的centos没有安装 rpmbuild 工具软件.以前的系统安装了,索性就安装了 rpmbuild软件 yum install rpm-build 然后 rpm -ivh vsftpd-3.0.2-22.el7.x86_64.rpm rpm -Uvh vsftpd-3.0.2-22.el7.x86_64.rpm 就安装好了 情况二: vsftpd

CentOS7安装MySQL并开启远程访问

1.安装MySQL CentOS7中默认安装了MySQL系列的数据库,需要先卸载掉. 查看当前安装的mariadb包: [[email protected] desktop]# rpm -qa | grep mariadb 将它们统统强制性卸载掉: [[email protected] 桌面]# rpm -e --nodeps mariadb-libs-5.5.35-3.el7.x86_64 在官网下载RPM安装包,http://dev.mysql.com/downloads/mysql/,下载

Centos7 安装 mysql

首先CentOS7 已经不支持mysql,因为收费了你懂得,所以内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,所以需要先卸载掉mariadb,以下为卸载mariadb,安装mysql的步骤. #列出所有被安装的rpm package rpm -qa | grep mariadb #卸载rpm -e mariadb-libs-5.5.44-2.el7.centos.x86_64 错误:依赖检测失败:libmysqlclient.so.18()(64bit) 被 (已安

CentOS 7.4 使用源码包编译安装MySQL 5.7.20

使用yum安装的MySQL一般版本比较旧,但是运行稳定.如果想要尝试最新的功能或者需要指定特殊的功能的话,就需要手工进行编译安装了. 一.下载安装包 (一).先下载MySQL源码,网址为:https://dev.mysql.com/downloads/mysql/ : 在Select Operationg System中选择Source Code: 在下面的Select OS Version选择Generic Linux(Architecture Independent): 然后再下面的部分可以

CentOS7安装Mysql并配置远程访问

(su root登录到root账户) 下载repo源 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 安装rpm包 rpm -ivh mysql-community-release-el7-5.noarch.rpm 安装mysql yum install mysql-server 执行后开始下载和解压操作,过程中会遇到多次Y/N询问,输入y然后回车确认 安装完成后再次查看mysql rpm -qa|grep