centos7 安装mysql5.7(二进制安装)
一、卸载默认安装的mariadb
[root@localhost ~]# yum remove mariadb* -y
二、添加mysql用户
[root@localhost ~]# useradd -s /sbin/nologin -M mysql
#-s 指定shell
#-M 不创建家目录
三、解压tar文件并移动到指定目录
[root@localhost ~]# tar zxvf mysql-5.7.-linux-glibc2.-x86_64.tar.gz
[root@localhost ~]# mv mysql-5.7.-linux-glibc2.-x86_64 mysql
[root@localhost ~]# mv mysql /usr/local/mysql
四、修改目录所属
[root@localhost ~]# chown -R mysql:mysql /usr/local/mysql/
五、初始化mysql
[root@localhost ~]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
--08T01::.343294Z [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
--08T01::.491621Z [Warning] InnoDB: New log files created, LSN=
--08T01::.530234Z [Warning] InnoDB: Creating foreign key constraint system tables.
--08T01::.587027Z [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: 7d4db01d-b97b-11e9-8ac2-000c290afcba.
--08T01::.588261Z [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
--08T01::.590350Z [Note] A temporary password is generated for root@localhost: 2op_Dr?L)klu
六、创建系统服务,并修改参数
[root@localhost ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@localhost ~]# vi /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
#修改上边俩行参数,添加指定的mysql目录和数据目录
七、编辑配置文件
[root@localhost ~]# vi /etc/my.cnf
[mysqld]
user= mysql
port=
socket=/tmp/mysql.sock
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
log-error=/usr/local/mysql/data/mysql.log
pid-file=/usr/local/mysql/data/mysql.pid
character-set-server=utf8
collation-server=utf8_bin
八、添加环境变量
[root@localhost ~]# vi .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
#添加上边这行环境变量
[root@localhost ~]# source .bash_profile
九、启动mysql
[root@localhost ~]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS!
十、修改mysql密码及允许远程登录
[root@localhost ~]# mysql -uroot -p
Enter password: #密码为初始化时,自动生成的密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. Copyright (c) , , 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=password('');
Query OK, rows affected, warning (0.00 sec) mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed mysql> select host,user from user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+---------------+
rows in set (0.00 sec) mysql> update user set host='%' where user='root';
Query OK, row affected (0.00 sec)
Rows matched: Changed: Warnings: mysql> flush privileges;
Query OK, rows affected (0.00 sec)
十一、添加系统服务及设置自启动
[root@localhost ~]# chkconfig --add mysqld
[root@localhost ~]# chkconfig --level mysqld on
注:记得关闭防火墙或者添加防火墙策略
centos7 安装mysql5.7(二进制安装)的更多相关文章
- [sql]mysql5.6cmake安装/mysql5.7二进制安装
centos7上cmake编译安装mysql-5.6.36.tar.gz 系统环境 - 环境(安装前规划好主机名,mysql编译过程会用) [root@n1 mysql-5.6.36]# cat /e ...
- CentOS6+MySQL5.6二进制安装
一般我们安装mysql采用二进制安装的方式就足以满足我们的生产环境了,不过需要我们配置my.cnf文件 从官网下载二进制MySQL,选择Linux-Generic,最后这两个是二进制包 http:// ...
- Linux中MySQL5.6编译安装与MySQL5.7二进制安装步骤
首先,介绍一下MySQL的几种安装方式 1.RPM.Yum 的安装方式:安装方便.安装速度快,无法定制 2.二进制:不需要安装,解压即可使用,不能定制功能 3.编译安装:可定制,安装慢. 编译安装中需 ...
- centos7下mysql5.7的安装与配置
centos7下MySQL5.7的安装与配置 下载 下载地址 根据系统和版本选择红框中的四个RPM包下载即可,然后放到centos7系统中的/opt目录下,等待稍后安装. 安装前的准备 1. 检查系统 ...
- CentOS7下MySQL5.7的安装-RPM方式
Installing MySQL on Linux Using RPM Packages 下载安装包 mysql下载地址:https://dev.mysql.com/downloads/mysql/ ...
- Centos7.3 之mysql5.7二进制安装
#!/bin/bash #注意,该脚本是在centos7.3非生产环境下测试的,其他版本的系统可能不适用,要根据情况修改.需要先下载好mysql二进制包到本地(我一般都是在root家目录下操作,文件也 ...
- centos 7下安装MySQL5.7 的安装和配置
原文链接: http://blog.csdn.net/xyang81/article/details/51759200 安装环境:CentOS7 64位 MINI版,安装MySQL5.7 1.配置Y ...
- centos7.2 mysql5.5编译安装
环境 centos7.2 源码包mysql5.5.38 mysql5.5开始,源码配置编译工具configure变成了cmake,所以先要去把cmake装上.并安装make,bison,cmake,g ...
- MySQL5.7二进制安装
MySQL-5.7.14从零开始-安装 首先我们要选择下载MySQL的版本: 登录官方网站下载:https://dev.mysql.com/downloads/mysql/ 下面我们选择5.7.14的 ...
- ubuntu mysql5.6二进制安装
200 ? "200px" : this.width)!important;} --> 介绍 以前一直使用centos今天需要对一台ubantu的系统安装mysql,虽然它也 ...
随机推荐
- JVM的监控工具之jhat
在上一篇文件文章中讲到了jhap的用法:https://www.cnblogs.com/cheng21553516/p/11223615.html,既然jhap可以转储堆的快照文件, 那么用什么来分析 ...
- CentOS6 + MapServer7.4编译
先升级gcc 1.python3.6 ./configure --enable-shared --enable-profiling make –j 20 make install 2.proj-4.9 ...
- 基于log4net的日志组件扩展封装,实现自动记录交互日志 XYH.Log4Net.Extend(微服务监控)
背景: 随着公司的项目不断的完善,功能越来越复杂,服务也越来越多(微服务),公司迫切需要对整个系统的每一个程序的运行情况进行监控,并且能够实现对自动记录不同服务间的程序调用的交互日志,以及通一个服务或 ...
- Delphi - OLE类实现TTS方式语音朗读
Delphi调用OLE类实现TTS方式语音朗读 直接看代码: unit uMain; interface uses Windows, Messages, SysUtils, Variants, Cla ...
- C#中全局作用域的常量、字段、属性、方法的定义与使用
场景 在开发中,经常会有一些全局作用域的常量.字段.属性.方法等. 需要将这些设置为全局作用域保存且其实例唯一. 注: 博客主页: https://blog.csdn.net/badao_liuman ...
- 浅析Java中线程组(ThreadGroup类)
Java中使用ThreadGroup类来代表线程组,表示一组线程的集合,可以对一批线程和线程组进行管理.可以把线程归属到某一个线程组中,线程组中可以有线程对象,也可以有线程组,组中还可以有线程,这样的 ...
- 腾讯WeTest携手拉夏贝尔共筑电商小程序安全壁垒
上海拉夏贝尔服饰股份有限公司成立于1998年,是中国快速发展的多品牌时尚运营企业.La Chapelle品牌创立初衷正是希望通过精美别致的时装设计,将法式优雅精致的风情元素和对生活的认知感悟传递给都市 ...
- 微信小程序的线程架构
小程序的线程架构 每个小程序包含一个描述整体程序的app实例和多个描述页面的page. 其中app由3个文件构成: app.json 公共配置文件 app.wxss 公共样式文件 app.js 主体逻 ...
- Scrum 冲刺第三篇
是我们是这次稳了队,队员分别是温治乾.莫少政.黄思扬.余泽端.江海灵 一.会议 1.1 27号站立式会议照片: 1.2 昨天已完成的事情 团队成员 今天计划完成的任务 黄思扬 活动平台首页(前端) ...
- 在js中==和===的区别
“==”:叫相等运算符 “===”:叫严格运算符 它们两有什么区别呢? == :表示值相等则都为true ===:表示 不仅要值相等,双方类型也要相等才为true 例子如下: js代码如下: // “ ...