0

I am working on a *nix machine and I don't have root privileges.

I am trying to install mysql locally using this blogpost: http://www.thedance.net/~roth/TECHBLOG/localMySQL.html

However, I am stuck at scripts/mysql_install_db command.

When I run this command I get the following error:

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

On further digging, I found that adding --basedirresolves this issue. But then it generates the following errors:

$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]

When I add --datadir=myDataDir (where myDataDir is a local directory) it generates following error:

$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' 

It is trying to access system level folders and because of the permission issues it is failing. How do I install it locally. And how do I setup the hostname?

2
  • manually install MySQL without sudo permission? hope you just use it as testing. Commented Jul 17, 2015 at 2:11
  • Similar case: superuser.com/questions/146337/… Commented Jul 17, 2015 at 2:13

1 Answer 1

1

The problem lies on the following line in log:

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

To solve it, add this flag to your command:

--lc-messages-dir="/some/path/you/can/access/without/sudo/"
Sign up to request clarification or add additional context in comments.

5 Comments

Wow that's wild stuff. Nice job Raptor
Hi Raptor, I am getting a very strange behavior with this. lets say my installation dir is $insdir. In there I created a directory messagedir and passed that lc-messages-dir=messagedir. However, I am getting the following error: Can't find messagefile $insdir/share/messagedir/errmsg.sys. Notice how messagedir got appended by share. I also tried creating a directory named messagedir in share folder but still get the same error
I tried the absolute path and also had it surrounded in quotes. I am still getting the error but the path is correct now. Error: Can't find messagefile $insdir/messagedir/errmsg.sys
I also changed the permission of messagedir to 777 just in case.. still can't find messagefile error
I think I found the source of the issue. This command in the file mysql-test/t/mysql_plugin.test : --copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys. I think $MYSQL_ERRMSG_BASEDIR doesn't exist

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.