Opened 11 years ago

Closed 11 years ago

#39728 closed defect (worksforme)

mysql55 @5.5.32_1 mysql_install_db fails when using _mysql user

Reported by: pearcemerritt@… Owned by: pixilla (Bradley Giesbrecht)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc:
Port: mysql55

Description

OS: 10.6.8
Xcode: 3.2.6

The following runs successfully:

$ sudo port selfupdate
$ sudo port install mysql55
$ sudo port install mysql55-server

Then, this fails:

~$ sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db
Installing MySQL system tables...
130714 12:39:01 [ERROR] /opt/local/lib/mysql55/bin/mysqld: Can't find file: './mysql/db.frm' (errno: 13)
ERROR: 1017  Can't find file: './mysql/db.frm' (errno: 13)
130714 12:39:01 [ERROR] Aborting

130714 12:39:01 [Note] /opt/local/lib/mysql55/bin/mysqld: Shutdown complete


Installation of system tables failed!  Examine the logs in
/opt/local/var/db/mysql55 for more information.

You can try to start the mysqld daemon with:

    shell> /opt/local/lib/mysql55/bin/mysqld --skip-grant &

and use the command line tool /opt/local/lib/mysql55/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /opt/local/lib/mysql55/bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /opt/local/var/db/mysql55 that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /opt/local/lib/mysql55/bin/mysqlbug script!

It does not fail if I omit -u _mysql. However, omitting -u _mysql causes other errors later (e.g. trying to run mysqld_safe fails, etc.)

Change History (4)

comment:1 Changed 11 years ago by larryv (Lawrence Velázquez)

Keywords: _mysql mysql_install_db removed
Owner: changed from macports-tickets@… to pixilla@…

Thanks for the ticket. In the future, please Cc relevant port maintainers.

comment:2 Changed 11 years ago by pixilla (Bradley Giesbrecht)

What are the permissions on your data directory:

$ ls -dl /opt/local/var/db/mysql55

The mysql55-server port should be creating the data directory with the proper permissions for you. To test this you can deactivate mysql55 and mysql55-server, move your data directory out of the way and finally reactivate mysql55 and mysql55-server:

$ sudo port deactivate mysql55-server mysql55
$ sudo mv /opt/local/var/db/mysql55{,-original}
$ sudo port activate mysql55 mysql55-server
$ sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db

comment:3 Changed 11 years ago by pearcemerritt@…

That worked! Thank you pixilla :)

For your info, here is the permissions you requested.

~$ ls -dl /opt/local/var/db/mysql55
drwx------  10 _mysql  admin  340 Jul 15 22:38 /opt/local/var/db/mysql55

I think I may have omitted the -u _mysql the first time I ever ran mysql_install_db which is my only guess as to why this may have occurred.

comment:4 Changed 11 years ago by pixilla (Bradley Giesbrecht)

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.