我正在使用* 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'
它正在尝试访问系统级文件夹,并且由于权限问题而失败。我如何在本地安装它。我如何设置主机名?
答案 0 :(得分:1)
问题在于日志中的以下行:
[错误]找不到消息文件'/usr/share/mysql/errmsg.sys'
要解决此问题,请将此标志添加到您的命令中:
--lc-messages-dir="/some/path/you/can/access/without/sudo/"