mysql本地安装mysql_install_db错误

标签 mysql

我正在 *nix 机器上工作,但没有 root 权限。

我正在尝试使用此博文在本地安装 mysql:http://www.thedance.net/~roth/TECHBLOG/localMySQL.html

但是,我陷入了 scripts/mysql_install_db 命令。

当我运行此命令时,出现以下错误:

FATAL ERROR: Neither host 'server.address.com' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script
with the --force option

经过进一步挖掘,我发现添加 --basedir 可以解决此问题。但随后它会生成以下错误:

$scripts/mysql_install_db --basedir=.
Installing MySQL system tables...2015-07-17 01:38:15 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-07-17 01:38:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-07-17 01:38:15 0 [Note] ./bin/mysqld (mysqld 5.6.25) starting as process 10281 ...
2015-07-17 01:38:15 10281 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
2015-07-17 01:38:15 10281 [Warning] Can't create test file /var/lib/mysql/head.lower-test
2015-07-17 01:38:15 10281 [Warning] Can't create test file /var/lib/mysql/head.lower-test
./bin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13 - Permission denied)
2015-07-17 01:38:15 10281 [ERROR] Aborting
2015-07-17 01:38:15 10281 [Note] Binlog end
2015-07-17 01:38:15 10281 [Note]

当我添加 --datadir=myDataDir (其中 myDataDir 是本地目录)时,它会生成以下错误:

$scripts/mysql_install_db --basedir=. --datadir=myDataDir
Installing MySQL system tables...2015-07-17 01:40:54 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-07-17 01:40:54 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-07-17 01:40:54 0 [Note] ./bin/mysqld (mysqld 5.6.25) starting as process 10329 ...
2015-07-17 01:40:54 10329 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 

它正在尝试访问系统级文件夹,但由于权限问题而失败。我如何在本地安装它。如何设置主机名?

最佳答案

问题出在日志中的以下行:

[ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'

要解决这个问题,请将此标志添加到您的命令中:

--lc-messages-dir="/some/path/you/can/access/without/sudo/"

关于mysql本地安装mysql_install_db错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31467374/

相关文章:

mysql - 从标签列表和直接搜索获取 MySQL 数据

MySQL 二进制日志复制 : Can it be set to ignore errors?

mysql - 对混合表数据进行排序

python - Flask 中的 If 语句使用 SQL 数据库中的字符串变量

php - textarea 的字段类型是什么?

mysql - 使用 VB.net 中的 MySql 中的值填充文本框

c# - 如何从 C# MySQL 查询中提取单个列数据?

php - 从数据库获取描述等文本时如何创建边距

mysql - 使用 SQL,以一种高性能的方式仅替换大文本字段中的一个段落中的字符串(使用子字符串、定位和替换、正则表达式等)

javascript - 在 Post 方法后重定向,expressjs