我最近在安装mysql 5.7.12,本来之前安装mysql 5.7.11时用命令

bin/mysqld --initialize --user=mysql

可以很好的初始化,但是用在5.7.12版本居然报错

[root@centos mysql-5.7.12]# bin/mysqld --initialize --user=mysql
2016-04-28T09:50:25.142068Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-28T09:50:25.142323Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2016-04-28T09:50:25.144865Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2016-04-28T09:50:25.144934Z 0 [ERROR] Aborting

后来发现centos自带的/etc/my.cnf和/etc/mysql没有删掉,后来删掉这两个文件之后在此使用这个命令

仍然报错

mysqld: Can't create directory '/usr/local/mysql/data/' (Errcode: 2 - No such file or directory)
2016-04-28T09:53:24.465575Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2016-04-28T09:53:24.467928Z 0 [ERROR] Aborting

后来在网上一查发现使用mysqld命令时要初始化

应该在mysql祝文件夹下创建data文件,但是记得在5.7.11版本里面的data文件是自动生成的

mkdir data

然后执行下面一句

bin/mysqld --user=mysql --basedir=/usr/local/mysql-5.7.12 --datadir=/usr/local/mysql-5.7.12/data/  --initialize

2016-04-28T10:01:07.730549Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-28T10:01:08.194212Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-04-28T10:01:08.725913Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-04-28T10:01:08.810579Z 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: 213135a4-0d28-11e6-b869-000c299613e3.
2016-04-28T10:01:08.816207Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-04-28T10:01:08.819712Z 1 [Note] A temporary password is generated for root@localhost: %?kTFF<e8XXL

这算是成功了把,给出了初始密码,接下来把support-files/my-default.cnf复制到/etc/下,并配置一下

就可以了!

mysql 5.7.12----bin/mysqld --initialize --user=mysql出错的更多相关文章

  1. mysql初始化时报错bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory的处理

    问题描述: 今天新安装了一个linux虚拟机,然后安装mysql 5.7.21,在进行初始化的时候,报错 bin/mysqld: error : cannot open shared object f ...

  2. mysql初始化/usr/local/mysql/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory

    [root@test153 ~]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql - ...

  3. Mysql 5.7.12解压版的安装及配置系统编码

    这篇博文是由于上篇EF+MySql博文引发的,上篇博文中在Seed方法中插入中文数据到Mysql数据库中乱码,后来网上找了N种方法也没解决.重装了MySql并在安装过程中配置了系统编码,此篇记录一下. ...

  4. 【Linux】CentOS 7.4 安装 MySQL 8.0.12 解压版

    安装环境/工具 1.Linux(CentOS 7.4版) 2.mysql-8.0.12-el7-x86_64.tar.gz 安装步骤 参考:https://dev.mysql.com/doc/refm ...

  5. Python3.7和数据库MySQL 8.0.12 绿色解压 安装教程(一)

    首先要安装MySQL 数据库才可以继续安装图形工具SQLyog 第一步:下载解压包>> MYSQL官网地址:https://dev.mysql.com/downloads/file/?id ...

  6. CentOS 7 编译 mysql 8.0.12

    步骤一:安装mysql依赖 yum install -y libaio numactl 步骤二:下载mysql社区版 wget https://dev.mysql.com/get/Downloads/ ...

  7. 集群架构03·MySQL初识,mysql8.0环境安装,mysql多实例

    官方网址 https://dev.mysql.com/downloads/mysql/社区版本分析 MySQL5.5:默认存储引擎改为InnoDB,提高性能和可扩展性,增加半同步复制 MySQL5.6 ...

  8. mysql更改数据文件目录及my.ini位置| MySQL命令详解

    需求:更改mysql数据数据文件目录及my.ini位置. 步骤: 1.查找my.ini位置,可通过windows服务所对应mysql启动项,查看其对应属性->可执行文件路径,获取my.ini路径 ...

  9. ubuntu16.04系统彻底卸载mysql,并源码免编译重装MySQL的步骤

    今天的总结 ubuntu上彻底卸载MySQL或重新安装 https://www.jianshu.com/p/974b33873bca #查看是否存在mysql服务 service mysql stat ...

随机推荐

  1. TCP/IP协议栈--IP首部选项字段的分析

    IP输入函数(ipintr)将在验证分组格式(检验和,长度等)之后.确定分组是否到达目的地之前,对选项进行处理. 这表明分组所 遇到的每一个路由器以及终于的目的主机都对要分组的选项进行处理. IP分组 ...

  2. 很轻很强大:轻量级桌面环境比较(转自linuxeden)

    这天你终于下定决心购买了一台流行的 Netbook ,与往常装机一样,直接安装心爱的 Linux 发行版.好不容易安装完成了,却发现平日启动飞快的应用程序在 Netbook 上怎么都跑不快.怎么办呢? ...

  3. 浅析iOS tableview的selectRowAtIndexPath选中无效(默认选中cell无效)

    可能很多人都遇到过这种情况: tableview列表,有时加载完,需要默认选中某一行,给予选中效果:或者需要执行某行的点击事件. 我们举例: 比如我想默认选中第一行 可能我们第一个想法就是这样: [m ...

  4. HDUOJ---汉洛塔IX

    汉诺塔IX Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  5. 【LeetCode】45. Jump Game II

    Jump Game II Given an array of non-negative integers, you are initially positioned at the first inde ...

  6. Comet入门及最简单的Java Demo

    在浏览网页的时候,假设有新的消息,怎样接收到?HTTP协议不能由server主动给client发送消息. 1.刷微博.逛论坛贴吧,想看最新的信息怎么办?F5刷新一下就OK了! 2.上面一种方式是被动的 ...

  7. 命令行查询DELL服务器信息序列号

    Windows 获取序列号>wmic bios get serialnumber 获取机型信息>wmic csproduct get vendor,name,identifyingnumb ...

  8. php 仿thinkphp的sql类库

    模仿thinkphp封装的类库 <?php /** * MySql操作类2015版 * 作者:咖啡兽兽 287962566@qq.com * 使用说明: * //包含文件 * inclode ' ...

  9. mysql两列合成一列

    update manage set mark = concat(mark,remark) select concat(mark,remark) as pp from manage

  10. 并发编程之socketserver模块

    一.socketserver模块介绍 基于tcp套接字,关键的就是两个循环,一个是链接循环,一个是通信循环 socketserver模块中分两大类:srever类(解决链接问题)和request类(解 ...