Linux 6.7 安装 MySQL 8.0.16

操作系统:

2.6.32-754.10.1.el6.x86_64

MySQL版本:8.0.16

下载地址:https://dev.mysql.com/downloads/

安装方法:

使用rpm安装

[[email protected]]# cd /opt/*******/data
[[email protected]]# mkdir mysql
[[email protected]]# tar xvf /var/tmp/mysql-8.0.16-1.el6.x86_64.rpm-bundle.tar -C  /opt/ericsson/data/mysql/
mysql-community-test-8.0.16-1.el6.x86_64.rpm
mysql-community-libs-compat-8.0.16-1.el6.x86_64.rpm
mysql-community-devel-8.0.16-1.el6.x86_64.rpm
mysql-community-server-8.0.16-1.el6.x86_64.rpm
mysql-community-client-8.0.16-1.el6.x86_64.rpm
mysql-community-common-8.0.16-1.el6.x86_64.rpm
mysql-community-libs-8.0.16-1.el6.x86_64.rpm

[[email protected] data]# cd mysql/
[[email protected] mysql]# ls -lh
total 646M
-rw-r--r-- 1 7155 31415  37M Apr 15 15:52 mysql-community-client-8.0.16-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 710K Apr 15 15:52 mysql-community-common-8.0.16-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 6.0M Apr 15 15:52 mysql-community-devel-8.0.16-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 3.4M Apr 15 15:52 mysql-community-libs-8.0.16-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 1.7M Apr 15 15:52 mysql-community-libs-compat-8.0.16-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 481M Apr 15 15:52 mysql-community-server-8.0.16-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 117M Apr 15 15:54 mysql-community-test-8.0.16-1.el6.x86_64.rpm

[[email protected] mysql]# rpm -ivh mysql-community-common-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-common-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-common ########################################### [100%]

[[email protected] mysql]# rpm -ivh mysql-community-libs-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-libs-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-libs   ########################################### [100%]

[[email protected]]# rpm -ivh mysql-community-server-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-server-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
        mysql-community-client(x86-64) >= 8.0.11 is needed by mysql-community-server-8.0.16-1.el6.x86_64 //先安装client

[[email protected]]# rpm -ivh mysql-community-client-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-client-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-client ########################################### [100%]

[[email protected]]# rpm -ivh mysql-community-server-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-server-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
        file /etc/my.cnf from install of mysql-community-server-8.0.16-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64

安装的时候没有注意到这个冲突,导致无法启动MySQL,实际是MySQL server没有安装成功

[[email protected]]# rpm -ivh mysql-community-devel-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-devel-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
        pkgconfig(openssl) is needed by mysql-community-devel-8.0.16-1.el6.x86_64  //有依赖

[[email protected]]# rpm -ivh mysql-community-libs-compat-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-libs-compat-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
        file /usr/lib64/mysql/libmysqlclient.so.16.0.0 from install of mysql-community-libs-compat-8.0.16-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
        file /usr/lib64/mysql/libmysqlclient_r.so.16.0.0 from install of mysql-community-libs-compat-8.0.16-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64 //有冲突

[[email protected] mysql]# rpm -ivh  mysql-community-devel-8.0.16-1.el6.x86_64.rpm --nodeps  //使用参数
warning: mysql-community-devel-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-devel  ########################################### [100%]
[[email protected]]#
[[email protected] mysql]# rpm -ivh  mysql-community-test-8.0.16-1.el6.x86_64.rpm  --nodeps
warning: mysql-community-test-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-test   ########################################### [100%]

安装完发现无法启动MySQL
[[email protected] mysql]# /etc/init.d/mysqld start
-bash: /etc/init.d/mysqld: No such file or directory
[[email protected] mysql]# mysql_install_db /var/lib/mysql
-bash: mysql_install_db: command not found
[[email protected]]# mysqld --initialize
-bash: mysqld: command not found

重新安装MySQL server发现报错

[[email protected] mysql]# rpm -ivh mysql-community-server-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-server-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
        file /etc/my.cnf from install of mysql-community-server-8.0.16-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
[[email protected] mysql]#
[[email protected] mysql]# rpm -qa | grep -i mysql
mysql-libs-5.1.73-5.el6_6.x86_64
mysql-community-libs-8.0.16-1.el6.x86_64
mysql80-community-release-el6-3.noarch
mysql-community-devel-8.0.16-1.el6.x86_64
mysql-community-common-8.0.16-1.el6.x86_64
mysql-community-test-8.0.16-1.el6.x86_64
mysql-community-client-8.0.16-1.el6.x86_64
[[email protected] mysql]# 

删除旧版本的libs mysql-libs-5.1.73-5.el6_6.x86_64
[[email protected] mysql]# rpm -e mysql-libs-5.1.73-5.el6_6.x86_64
error: Failed dependencies:
        libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
        libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
[[email protected] mysql]#
[[email protected] mysql]# rpm -e mysql-libs-5.1.73-5.el6_6.x86_64 --nodeps
[[email protected] mysql]# rpm -qa | grep -i mysql
mysql-community-libs-8.0.16-1.el6.x86_64
mysql80-community-release-el6-3.noarch
mysql-community-devel-8.0.16-1.el6.x86_64
mysql-community-common-8.0.16-1.el6.x86_64
mysql-community-test-8.0.16-1.el6.x86_64
mysql-community-client-8.0.16-1.el6.x86_64
[[email protected] mysql]# 

安装mysql-community-server
[[email protected] mysql]# rpm -ivh mysql-community-server-8.0.16-1.el6.x86_64.rpm
warning: mysql-community-server-8.0.16-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-server ########################################### [100%]
[[email protected] mysql]#
[[email protected] mysql]# 

启动MySQL
[[email protected] mysql]# service mysqld start
Initializing MySQL database:                               [  OK  ]
Starting mysqld:                                           [  OK  ]
[[email protected] mysql]# uname -r
2.6.32-754.10.1.el6.x86_64
[[email protected] mysql]# grep ‘temporary password‘ /var/log/mysqld.log

2019-04-29T14:33:46.158054Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: t=Njoyw42aRU

[[email protected] mysql]# mysql -uroot -p 

Enter password: 

Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.16

Copyright (c) 2000, 2019, 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> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘Eric_029‘; Query OK, 0 rows affected (0.02 sec)
 1 mysql> show databases;
 2 +--------------------+
 3 | Database           |
 4 +--------------------+
 5 | information_schema |
 6 | mysql              |
 7 | performance_schema |
 8 | sys                |
 9 +--------------------+
10 4 rows in set (0.00 sec)
11
12 mysql> show tables;
13 ERROR 1046 (3D000): No database selected
14 mysql> use mysql;
15 Reading table information for completion of table and column names
16 You can turn off this feature to get a quicker startup with -A
17
18 Database changed
19 mysql> show tables;
20 +---------------------------+
21 | Tables_in_mysql           |
22 +---------------------------+
23 | columns_priv              |
24 | component                 |
25 | db                        |
26 | default_roles             |
27 | engine_cost               |
28 | func                      |
29 | general_log               |
30 | global_grants             |
31 | gtid_executed             |
32 | help_category             |
33 | help_keyword              |
34 | help_relation             |
35 | help_topic                |
36 | innodb_index_stats        |
37 | innodb_table_stats        |
38 | password_history          |
39 | plugin                    |
40 | procs_priv                |
41 | proxies_priv              |
42 | role_edges                |
43 | server_cost               |
44 | servers                   |
45 | slave_master_info         |
46 | slave_relay_log_info      |
47 | slave_worker_info         |
48 | slow_log                  |
49 | tables_priv               |
50 | time_zone                 |
51 | time_zone_leap_second     |
52 | time_zone_name            |
53 | time_zone_transition      |
54 | time_zone_transition_type |
55 | user                      |
56 +---------------------------+
57 33 rows in set (0.00 sec)

MySQL Installation Layout for Linux RPM Packages from the MySQL Developer Zone

Files or Resources Location
Client programs and scripts /usr/bin
mysqld server /usr/sbin
Configuration file /etc/my.cnf
Data directory /var/lib/mysql
Error log file
For RHEL, Oracle Linux, CentOS or Fedora platforms:               /var/log/mysqld.log

For SLES: /var/log/mysql/mysqld.log

Value of secure_file_priv /var/lib/mysql-files
System V init script
For RHEL, Oracle Linux, CentOS or Fedora platforms:               /etc/init.d/mysqld

For SLES: /etc/init.d/mysql

Systemd service
For RHEL, Oracle Linux, CentOS or Fedora platforms:               mysqld

For SLES: mysql

Pid file /var/run/mysql/mysqld.pid
Socket /var/lib/mysql/mysql.sock
Keyring directory /var/lib/mysql-keyring
Unix manual pages /usr/share/man
Include (header) files /usr/include/mysql
Libraries /usr/lib/mysql
Miscellaneous support files (for example, error messages, and character            set files)
/usr/share/mysql                                                                      

原文地址:https://www.cnblogs.com/coreloving/p/10790391.html

时间: 2024-10-07 04:16:55

Linux 6.7 安装 MySQL 8.0.16的相关文章

MAC下安装MySQL 8.0.16教训记录

问题 花了两天多时间才算解决问题!原来也在几个环境下使用过MySQL,而且也熟悉另外几个关系数据库,原以为也就是安装时间上花费一点.但是,现在总结来看,对于MAC下知识了解还是太少,导致走了不少弯路.现记录于此,有兴趣的朋友参考一下. 我使用的是从Oracle官方网站上下载目前最新的mysql-8.0.16-macos10.14-x86_64.dmg安装方式.一开始的安装过程没有问题,与其他.dmg文件的安装方式大同小异. 但是,安装结束后,在MAC终端上运行如下命令出错: mysql -uro

Linux 源码安装MariaDB 10.0.16

cmake软件 tar -zxvf cmake-2.8.8.tar.gz cd cmake-2.8.8 ./bootstrap make && make install 依赖包 yum install ncurses-devel -y yum install pcre pcre-devel -y yum install gcc* -y 创建用户 groupadd mysql useradd -g mysql mysql echo "oracle" |passwd --s

【Linux】Ubuntu安装Mysql 8.0

1.下载Mysql的安装配置,http://dev.mysql.com/downloads/repo/apt/ 2.执行配置配置文件 sudo dpkg -i mysql-apt-config_0.*.****_all.deb (要执行的安装包名称) 会弹出一个紫色的配置框出来,选中安装Mysql8.0,然后选中Ok退出. 3.更新配置 sudo apt update 4.按此方法在安装时,会要求输入Mysql的Root 的密码 5.然后要会要求设置加密方式,一定要选择下面的弱加密. 6.安装完

在Linux(CentOS)上安装MySql详细记录

前记:  毕业两年了,前两天换了份工作,由以前的传统行业跳到了互联网行业.之前的公司一直在用WinServer2003+Tomcat+SqlServer/Oracle这套部署环境.对于Linux+Tomcat(或其他容器)+Mysql这套之前没用用过.所以利用这周末的我在阿里云上49元搞了个linux(centos 64位)的服务器. 刚开始先装了JDK1.6,安装了Tomcat6.0.这过程中没有遇到太大的问题, 小问题也google一下就解决了.而周六晚上开始安装Mysql,于是到今天下午为

CentOS7 下源码安装MySQL 8.0.11

CentOS7 下源码安装MySQL 8.0.11 系统环境:CentOS7, 内核:Linux 3.10.0-862.el7.x86_64 如果有旧版本的MySQL,先卸载,用下面命令来查询出系统有哪些相关的MySQL包. rpm -qa | grep mysql 如果上述命令查询出有相关的MySQL包,就卸载 rpm -e 包名 卸载MariaDB包 yum remove mariadb-libs.x86_64 从MySQL官网下载源码包,并将该文件拷贝到系统中. https://dev.m

linux系统下安装mysql数据库(mysql-5.7)

前言: 本文主要介绍如何在linux系统下安装mysql数据库及安装时遇到各种问题该如何解决:     本次安装使用的linux系统是centos,数据库版本是mysql-5.7. 一.安装前准备 root用户登录只linux服务器,在根目录下新建数据库安装目录  /software/mysql:数据库文件数据位置:/data/mysql(可以根据自己的习惯创建) 然后从oracle官网上下载mysql安装包:可以在自己电脑上先下载再上传到linux服务上,如果linux服务器可以访问外网,也可

安装 Mysql 8.0.x 的艰难体验

背景: Mysql 8.0 以后版本,在性能等方面有了很大提升,而且在自动编号.Timestamp等字段的设置上有了很方便的进步,因此在一年前即开始将原有的基于5.5版本的服务器逐渐向8.0.x 转移.但转移的过程问题颇多,主要的几个障碍如下: 1.需要各种visual c++ 的可发布版本:(8.0以后的小版本要求有所不同) 2.需要python 3.7版本.(8.0以后的小版本要求有所不同) 第一次安装时相对顺利,可能的原因是该服务器是一个“干净”的服务器,而且安装的是8.0.16版Mysq

Linux系统中安装MySQL数据库操作手册

Linux系统中MySQL数据库安装手册 一.安装概述: 在Linux操作系统中安装MySQL数据库是一个我们必须要掌握的一门技术,也决定了你以后找工作的薪资待遇,所以你知道它的厉害了吧!学会安装只是第一步,你还得学好数据库的基本操作,以及搭建一个数据库的主从配置等等.这些我都会在后面的博文中说到.下面我就简单的写一些安装MySQL数据库的一些步骤,仅供参考,如有什么不妥的地方,还请见谅! 二.安装步骤: (一)基本准备工作 1.打开虚拟机,在虚拟机中下载好最新版的MySQL数据库的压缩包.在M

CentOS 6.4下编译安装MySQL 5.6.16

一.卸载旧版本MySql 1.rpm卸载: 1> 检查安装包: rpm -qa | grep mysql 2> 普通删除: rpm -e mysql-5.6.16.rpm 3> 强力删除.如果使用上面命令删除时,提示有依赖的其他文件,则使用该命令可以对其进行强力删除. rpm -e --nodeps mysql-5.6.16.rpm 2.tar卸载: 1> 删除临时文件: make clean 2> 卸载 make uninstall 3> 删除解压文件 rm  -rf