Linux mysql-5.7.11 Setup

1、rpm bundel包下载到 /usr/local/src中:

[[email protected]localhost src]# ls
mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar

2解压缩bundle包

[[email protected] src]# tar xf mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar  [[email protected] src]# ls
mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar
mysql-community-client-5.7.11-1.el6.x86_64.rpm
mysql-community-common-5.7.11-1.el6.x86_64.rpm
mysql-community-devel-5.7.11-1.el6.x86_64.rpm
mysql-community-embedded-5.7.11-1.el6.x86_64.rpm
mysql-community-embedded-devel-5.7.11-1.el6.x86_64.rpm
mysql-community-libs-5.7.11-1.el6.x86_64.rpm
mysql-community-libs-compat-5.7.11-1.el6.x86_64.rpm
mysql-community-server-5.7.11-1.el6.x86_64.rpm
mysql-community-test-5.7.11-1.el6.x86_64.rpm

3.安装mysql-community-server之前,必须安装mysql-community-client和mysql-community-common  rpm包。而安装community-client和community-common包之前,必须删除mysql-lib(系统自带的版本过低)

[[email protected] src]# rpm -qa | grep mysql
mysql-libs-5.1.73-3.el6_5.x86_64

[[email protected] src]# yum remove mysql-libs
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 19475.
Another app is currently holding the yum lock; waiting for it to exit...   The other application is: PackageKit     Memory :  39 M RSS (569 MB VSZ)

Dependencies Resolved

===========================================================================================  Package                              Arch                         version                                Repositor
===================================================================================================================
Removing:  mysql-libs                           x86_64                       5.1.73-3.el6_5                         @anaconda
Removing for dependencies:  cronie                               x86_64                       1.4.4-12.el6                           @anaconda  cronie-anacron                       x86_64                       1.4.4-12.el6                           @anaconda  crontabs                             noarch                       1.10-33.el6                            @anaconda  postfix                              x86_64                       2:2.6.6-6.el6_5                        @anaconda  sysstat                              x86_64                       9.0.4-27.el6                           @anaconda

Transaction Summary
===================================================================================================================
Remove        6 Package(s)

Installed size: 15 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction   Erasing    : sysstat-9.0.4-27.el6.x86_64                                                                            Erasing    : cronie-1.4.4-12.el6.x86_64                                                                             Erasing    : cronie-anacron-1.4.4-12.el6.x86_64                                                                     Erasing    : crontabs-1.10-33.el6.noarch                                                                            Erasing    : 2:postfix-2.6.6-6.el6_5.x86_64                                                                         Erasing    : mysql-libs-5.1.73-3.el6_5.x86_64                                                                       Verifying  : cronie-anacron-1.4.4-12.el6.x86_64                                                                     Verifying  : mysql-libs-5.1.73-3.el6_5.x86_64                                                                       Verifying  : sysstat-9.0.4-27.el6.x86_64                                                                            Verifying  : crontabs-1.10-33.el6.noarch                                                                            Verifying  : cronie-1.4.4-12.el6.x86_64                                                                             Verifying  : 2:postfix-2.6.6-6.el6_5.x86_64                                                                       Removed:   mysql-libs.x86_64 0:5.1.73-3.el6_5                                                                                Dependency Removed:   cronie.x86_64 0:1.4.4-12.el6    cronie-anacron.x86_64 0:1.4.4-12.el6    crontabs.noarch 0:1.10-33.el6    postfix.

Complete!

4.上面卸载了mysql-lib旧的包,现在安装mysql-lib最新版的文件,这个包在rpm-bundle里面都有,

直接安装即可

[[email protected] src]# rpm -ivh mysql-community-common-5.7.11-1.el6.x86_64.rpm  warning: mysql-community-common-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]    1:mysql-community-common ########################################### [100%]
[[email protected] src]# ls
mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar        mysql-community-embedded-5.7.11-1.el6.x86_64.rpm        mysql-commu
mysql-community-client-5.7.11-1.el6.x86_64.rpm  mysql-community-embedded-devel-5.7.11-1.el6.x86_64.rpm  mysql-commu
mysql-community-common-5.7.11-1.el6.x86_64.rpm  mysql-community-libs-5.7.11-1.el6.x86_64.rpm
mysql-community-devel-5.7.11-1.el6.x86_64.rpm   mysql-community-libs-compat-5.7.11-1.el6.x86_64.rpm
[[email protected] src]# rpm -ivh mysql-community-libs-5.7.11-1.el6.x86_64.rpm  warning: mysql-community-libs-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]    1:mysql-community-libs   ########################################### [100%]
[[email protected] src]# rpm -ivh mysql-community-client-5.7.11-1.el6.x86_64.rpm  warning: mysql-community-client-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]    1:mysql-community-client ########################################### [100%]
[[email protected] src]# rpm -ivh mysql-community-server-5.7.11-1.el6.x86_64.rpm  warning: mysql-community-server-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]    1:mysql-community-server ########################################### [100%]

5.启动mysql 服务

[[email protected] src]# service mysql start
mysql: unrecognized service
[[email protected] src]# service mysqld start
Initializing MySQL database:                               [  OK  ]
Installing validate password plugin:                       [  OK  ]
Starting mysqld:                                           [  OK  ]
[[email protected] src]# netstat -tlunp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name    tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1525/sshd            tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1384/cupsd           tcp        0      0 :::22                       :::*                        LISTEN      1525/sshd            tcp        0      0 ::1:631                     :::*                        LISTEN      1384/cupsd           tcp        0      0 :::3306                     :::*                        LISTEN      19928/mysqld         udp        0      0 0.0.0.0:68                  0.0.0.0:*                               19346/dhclient       udp        0      0 0.0.0.0:631                 0.0.0.0:*                               1384/cupsd

6.rpm安装mysql后,会自动初始化一个密码,在日志中

[[email protected] src]# cat /var/log/mysqld.log | more
2016-03-11T01:44:19.913630Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --ex
plicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-11T01:44:22.271099Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-03-11T01:44:22.584299Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-03-11T01:44:23.050146Z 0 [Warning] No existing UUID has been found, so we assume that this is the first  time that this server has been started. Generating a new UUID: c7bf1a6a-e72a-11e5-8737-000c29a05942.
2016-03-11T01:44:23.062259Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed‘ cann
ot be opened.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2016-03-11T01:44:23.093873Z 1 [Note] A temporary password is generated for [email protected]: 8%<rjn;+,11Y

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2016-03-11T01:44:28.470492Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --ex
plicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-11T01:44:28.471726Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.11) starting as process 19672 ...
2016-03-11T01:44:28.626135Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-03-11T01:44:28.626205Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-11T01:44:28.626220Z 0 [Note] InnoDB: Uses event mutexes
2016-03-11T01:44:28.626233Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier

7.修改 mysql root密码,由于最新的mysql版本对密码策略有要求,所以必须增加复杂程度才能通过

注意,用刚才的随机密码登陆mysql.

[[email protected] src]# mysql -uroot -p
Enter password: 此处输入刚才日志文件中的随机密码
Welcome to the MySQL monitor.  commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.7.11

Copyright (c) 2000, 2016, 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> set password=‘[email protected]‘;
Query OK, 0 rows affected (0.15 sec)

mysql> quit;
Bye

[[email protected] src]# mysql -uroot -p
Enter password:  Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.7.11 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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只允许locathost本地登陆,用mysql workbentch 是无法远程登陆的。

[email protected],代表root只允许本地用户登陆,

所以必须允许root 从任何IP地址登陆。

mysql> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘[email protected]‘;
时间: 2024-10-26 16:48:06

Linux mysql-5.7.11 Setup的相关文章

如何在Ubuntu Linux上安装 MySQL 8.0.11

继MySQL 5.7之后,直接跳到了MySQL 8.0,官方说这次来了个大升级,其他的不说,就访问速度是5.7的2倍,因此我也尝试安装使用,根据官方文档,下面是安装的过程 一.工具 Ubuntu 16.04 MySQL Community Server 8.0.11 二.安装过程 1. 下载安装包 选择的是Linux 64位通用的二级制版本,这样不在需要进行编译安装,系统安装依赖库后就可以直接使用. 2. 安装依赖库 官方说要安装libaio,但实际如果你安装libaio库的话不行,还需安装nu

Red Hat 6.5 编译安装Mysql 5.7.11

安装操作系统注意事项–开发包四个选项全部选择安装 yum配置方便使用 挂载本地光盘到系统:把rhel6.5安装光盘放入光驱,在终端命令行下操作      mkdir /media/rhel   #新建挂载目录      mount /dev/cdrom  /media/rhel  #挂载光盘到/media/rhel目录下      cd  /media/rhel  #进入挂载目录      ls   #查看挂载目录,光盘挂载成功 配置本地yum源 cd/etc/yum.repos.d/   #进

Linux MYSQL 数据库

Linux MYSQL  数据库 1.1.概述: DBMS datebase management system  数据库管理系统 DML:date manapulate lanaguage  数据操作语言 INSERT,REPLACE,UPDATE,DELETE DLL: Date Defination Lanauage 数据定义语言 CREATE,创建数据库 ALTER,修改数据库 DROP 删除数据库和表 DCL:Date Control Language 数据控制语言 常用数据库软件 O

linux mysql 操作命令(转)

1.linux下启动mysql的命令:mysqladmin start/ect/init.d/mysql start (前面为mysql的安装路径) 2.linux下重启mysql的命令:mysqladmin restart/ect/init.d/mysql restart (前面为mysql的安装路径) 3.linux下关闭mysql的命令:mysqladmin shutdown/ect/init.d/mysql shutdown (前面为mysql的安装路径) 4.连接本机上的mysql:进

Mysql 5.7.11源码安装方法

环境:Centos 6.6 64位mysql 5.7.11 1.安装依赖包 yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison 2.安装boost库(对应版本高于或低于这个版本都有问题) wget http://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_

Linux Mysql 1130错误解决

今天在win32下通过navicat 远程登录Mysql时出现如下错误: 想都不用想,肯定是Mysql的访问权限问题. 首先,通过终端(我用的是SSH)远程登录到Linux服务器,为了安全起见,先改一下Mysql数据的root用户密码: ? 1 2 3 4 5 6 7 8 9 10 11 [plain]  [[email protected] ~]$ mysqladmin -u root password 123456   [[email protected] ~]$ mysql -uroot

mysql 8.0.11 二进制安装

#!/bin/bash ## 2018-5-24 ## hequan mkdir -p /data/src/ cd /data/src/ if [ ! -f mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz ]; then wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz fi yum install -y numactl.x86

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的安装

1.   下载 http://dev.mysql.com/downloads/mysql/ 或者使用wget下载: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.22-1.el6.i686.rpm-bundle.tar 2.   安装 2.1. 检测是否已经安装了mysql rpm -qa | grep mysql 如果已经安装了,将其卸载,如: rpm -e --nodeps  mysql-libs-5.1.73-5.e

linux mysql 命令

linux mysql 操作命令 Mysql命令大全