Mysql 二进制安装方法

下载mysql

https://dev.mysql.com/downloads/mysql/

1.解压包

tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz

2.实际生产环境

mv mysql-5.7.24-linux-glibc2.12-x86_64  /usr/local/mysql5.7

a.新增Mysql用户组

groupadd mysql

b. 新增用户

opt]# useradd -r -g mysql mysql

C.给mysql 目录权限

chown -R mysql:mysql mysql5.7

3. 到初始化环境的目录

Cd /home/usr/local/mysql5.6/

mkdir data

mkdir log

chown -R mysql:mysql mysql5.7

4.初始化数据和指定安装目录和数据目录

./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql5.7/ --datadir=/usr/local/mysql5.7/data/

6复制启动文件

cp mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

7.修改启动路径

vi /etc/init.d/mysqld

basedir= /usr/local/mysql5.7

datadir= /usr/local/mysql5.7/data

8.增加环境变量 (最下面添加)l

vi /etc/profile

export MYSQL_HOME=" /usr/local/mysql5.7"

export PATH="$PATH:$MYSQL_HOME/bin"

9.刷新配置文件

source /etc/profile

修改配置文件

vi /etc/my.cnf

[client]

port=3306

[mysqld]

basedir=/usr/local/mysql5.7

datadir=/usr/local/mysql5.7/data

#socket=/usr/local/mysql5.7/mysql.sock

socket=/tmp/mysql.sock

user=mysql

#skip-grant-tables

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

# Settings user and group are ignored when systemd is used.

# If you need to run mysqld under a different user or group,

# customize your systemd unit file for mariadb according to the

# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]

log-error=/usr/local/mysql5.7/log/mysqld.log

pid-file=/usr/local/mysql5.7/data/mysqld.pid

#

# include all files from the config directory

#

!includedir /etc/my.cnf.d

11.添加开启自启

chkconfig --add mysqld

chkconfig mysqld on

12.启动mysqld

service mysqld start

netstat -anpt

13.修改密码(密码初始化的时候有个密码)

2018-11-02T02:07:44.574468Z 1 [Note] A temporary password is generated for root@localhost: lXyB0%fi#9-S (这个就是密码)

mysql> help contents

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

mysql> help contents

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

mysql> show databases;

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

解决办法

1、 修改用户密码

mysql> alter user 'root'@'localhost' identified by 'youpassword';

或者

mysql> set password=password("youpassword");

2、刷新权限

mysql> flush privileges;

mysql> help contents

Centos 7 安装mysql5.7.24二进制 版本的更多相关文章

  1. [转]阿里云CentOS 7.1使用yum安装MySql5.6.24

    阿里云CentOS 7.1使用yum安装MySql5.6.24 作者:vfhky | 时间:2015-06-25 09:43 | 分类:web 在前面两篇文章<2015博客升级记(四):Cent ...

  2. centos 6.5 下安装RabbitMQ-3.7.28 二进制版本

    centos 6.5 下安装RabbitMQ-3.7.28 二进制版本 安装依赖: yum install -y ncurses-devel socat logrotatewxWidgets-deve ...

  3. Windows Server 2012安装mysql5.7.24记录

    系统环境: 一.下载mysql5.7.24安装包 地址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 下载解压到相应的目录,我的路径 ...

  4. centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'

    centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'的解决办法 3.7版本需要一个新的包libffi-de ...

  5. CentOs 7 安装mysql5.7.18(二进制版本)

    1.下载二进制版本安装包.搜狐开源镜像站:http://mirrors.sohu.com/mysql/MySQL-5.7/   , 找 mysql-5.7.18-linux-glibc2.5-x86_ ...

  6. Centos 7.5安装 Mysql5.7.24

    1. 下载 MySQL 本文采用的Linux为是腾讯云 标准型S2 (1 核 1 GB) Centos 7.5 64位  1.1 官网下载地址: https://dev.mysql.com/downl ...

  7. 基于通用二进制方式安装MySQL-5.7.24(比源码安装MySQL快许多)及破密码

    确保系统中有依赖的libaio软件 yum -y install libaio 使用wget命令下载mysql-5.7.24软件包 wget http://mirrors.sohu.com/mysql ...

  8. CentOS6.6安装mysql-5.7.25二进制安装包简易教程

    #####1,安装前首先确认系统版本 [root@bogon:~]# cat /etc/redhat-release CentOS release 6.6 (Final) [root@bogon:~] ...

  9. centos7安装mysql-5.6.43二进制包

    卸载老版本的MySQL.查找并删除mysql有关的文件 # find / -name mysql # rm -rf /usr/lib64/mysql /usr/share/mysql [root@lo ...

随机推荐

  1. Jboss 4.2.3配置与优化

    1      Jboss内存优化 修改这个两参数,给jvm分配适当的内存,一般为服务器的3/4内存量,推荐至少使用4G内存. 另外添加两个参数 -XX:+UseParallelGC -XX:+UseP ...

  2. 10分钟让你明白MySQL是如何利用索引的

    一.前言 在MySQL中进行SQL优化的时候,经常会在一些情况下,对MySQL能否利用索引有一些迷惑. 譬如: MySQL 在遇到范围查询条件的时候就停止匹配了,那么到底是哪些范围条件? MySQL ...

  3. Linux 中 FQDN 查询及设置

    FQDN:(Fully Qualified Domain Name)全限定域名:同时带有主机名和域名的名称 其实就是标注一个主机的完整域名.比如我的域名为 ifrom.top 那么它的邮件服务器的主机 ...

  4. excel如何冻结首行或首列及首行首列同时冻结

    冻结首行方法: 首先选择首行,在菜单栏选择视图菜单,再选择冻结窗格下拉三角里的冻结首行即可. 效果如下:拖动垂直滚动条 冻结首列方法: 首先选择首列,在菜单栏选择视图菜单,再选择冻结窗格下拉三角里的冻 ...

  5. replace 用法

    orcl中replace()用法: replace:(字符串 | 列):进行替换: 将bqh1表中name列带“小”的字改成“大”: select * from bqh1select a.*,repl ...

  6. sysbench压力工具报错:

    [root@ sysbench-]# /usr/local/sysbench/bin/sysbench --version : cannot open shared object file: No s ...

  7. 邮件客户端修改密码—OWA

    邮件客户端修改密码—OWA 1.登录OWA 2.输入用户名 3.点击选项 4.更改密码

  8. 基于CNN网络的汉字图像字体识别及其原理

    现代办公要将纸质文档转换为电子文档的需求越来越多,目前针对这种应用场景的系统为OCR系统,也就是光学字符识别系统,例如对于古老出版物的数字化.但是目前OCR系统主要针对文字的识别上,对于出版物的版面以 ...

  9. Java继承访问权限

    JAVA 子类重写继承的方法时,不可以降低方法的访问权限,子类继承父类的访问修饰符要比父类的更大,也就是更加开放,假如我父类是protected修饰的,其子类只能是protected或者public, ...

  10. leetcode25—Search Insert Position

    Given a sorted array and a target value, return the index if the target is found. If not, return the ...