无法打开和锁定特权表:表'mysql.user'不存在 [英] Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

查看:194
本文介绍了无法打开和锁定特权表:表'mysql.user'不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用二进制zip安装了MySQL社区服务器5.7.10.我在c:\mysql中解压缩了zip,并在c:\mysql\data中创建了数据文件夹.我将配置文件创建为my.ini,并将其放置在c:\mysql(提取的zip的根文件夹)中.以下是my.ini文件的内容

I installed MySQL community server 5.7.10 using binary zip. I extracted the zip in c:\mysql and created the data folder in c:\mysql\data. I created the config file as my.ini and placed it in c:\mysql (root folder of extracted zip). Below is the content of the my.ini file

# set basedir to your installation path
basedir=C:\mysql
# set datadir to the location of your data directory
datadir=C:\mysql\data

我正在尝试使用mysqld --console启动MySQL,但是该过程因以下错误而中止.

I'm trying to start MySQL using mysqld --console, but the process is aborted with the below error.

2015-12-29T18:04:01.141930Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2015-12-29T18:04:01.141930Z 0 [ERROR] Aborting 

在此方面的任何帮助将不胜感激.

Any help on this will be appreciated.

推荐答案

您必须通过运行以下命令来初始化数据目录

You have to initialize the data directory by running the following command

mysqld --initialize [使用随机根密码]

mysqld --initialize [with random root password]

mysqld --initialize-insecure [使用空白的root密码]

mysqld --initialize-insecure [with blank root password]

这篇关于无法打开和锁定特权表:表'mysql.user'不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆