mysql server problems

Ryan Schmidt ryandesign at macports.org
Tue May 13 14:58:20 PDT 2008


On May 13, 2008, at 3:28 PM, Patrick Gundlach wrote:

> I googled but I don't succeed on using mysql.
>
> The machine: Mac OS X Tiger (10.4.11) on intel, MacPorts 1.600,   
> mysql5 @5.0.51a_0+server (active)
>
> I've read somewhere that I have to run the following command:
>
> ~$ sudo -u mysql mysql_install_db5
>
> But this fails:
>
>> Installing MySQL system tables...
>> 080513 22:10:43 [Warning] Setting lower_case_table_names=2 because  
>> file system for /opt/local/var/db/mysql5/ is case insensitive
>> ERROR: 1347  'mysql.db' is not BASE TABLE
>> 080513 22:10:44 [ERROR] Aborting
>> 080513 22:10:44 [Note] /opt/local/libexec/mysqld: Shutdown complete
>> Installation of system tables failed!
>> Examine the logs in /opt/local/var/db/mysql5 for more information.
>> You can try to start the mysqld daemon with:
>> /opt/local/libexec/mysqld --skip-grant &
>> and use the command line tool
>> /opt/local/lib/mysql5/bin/mysql to connect to the mysql
>> database and look at the grant tables:
>> shell> /opt/local/lib/mysql5/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/mysql5 that may be helpful.
>
>
> Looks like permission problems, and the server logs say the same:
>
>> 080511 19:44:56  mysqld started
>> 080511 19:44:56 [Warning] Setting lower_case_table_names=2 because  
>> file system for /opt/local/var/db/mysql5/ is case  
>> insensitiveInnoDB: Log scan progressed past the checkpoint lsn 0 368
>> 08080511 19:44:56  InnoDB: Database was not shut down normally!
>> InnoDB: Starting crash recovery.
>> InnoDB: Reading tablespace information from the .ibd files...
>> InnoDB: Restoring possible half-written data pages from the  
>> doublewrite
>> InnoDB: buffer...
>> InnoDB: Doing recovery: scanned up to log sequence number 0 43655
>> 080511 19:44:57  InnoDB: Starting an apply batch of log records to  
>> the database...
>> InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16  
>> 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38  
>> 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60  
>> 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82  
>> 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
>> InnoDB: Apply batch completed
>> 080511 19:44:57  InnoDB: Started; log sequence number 0 43655
>> 080511 19:44:58 [ERROR] /opt/local/libexec/mysqld: Can't find  
>> file: './mysql/host.frm' (errno: 13)
>> 080511 19:44:58 [ERROR] /opt/local/libexec/mysqld: Can't find  
>> file: './mysql/host.frm' (errno: 13)
>> 080511 19:44:58 [ERROR] Fatal error: Can't open and lock privilege  
>> tables: Can't find file: './mysql/host.frm' (errno: 13)
>> 080511 19:44:58  mysqld ended
>
>
> the files in /opt/local/var/db/mysql5 are mysql:admin, those in the  
> subdirectory mysql are root:admin (as well as the host.frm from the  
> log). How did these get to root:admin?
>
> I started the server with launchctl load -w ...
>
> $ ps -ax | grep mysq
>  9072  ??  Ss     0:00.01 /opt/local/bin/daemondo --label=mysql5 -- 
> start-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/ 
> mysql5.wrapper start
>  9159  ??  Ss     0:00.02 /opt/local/bin/daemondo --label=mysql5 -- 
> start-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/ 
> mysql5.wrapper start
>
>
> So my question is: what have I done wrong installing the mysql5 db?  
> Which actions can I take to get it running?

Not sure what went wrong... Not sure why those files ended up owned  
by root instead of the mysql user, since you used "sudo -u mysql"  
that should have worked. If that's the only problem just change the  
ownership:

sudo chown -R mysql /opt/local/var/db/mysql5

I myself had some trouble installing mysql5 recently, and it turned  
out that mysql_install_db didn't like something in my my.cnf file. I  
had to move the my.cnf file out of the way for the duration of the  
initial db installation. Then I could move it back. My error message  
was different, but if just changing the permissions doesn't help,  
blow away the /opt/local/var/db/mysql5 directory, temporarily disable  
your my.cnf, wherever you put it, and try again.



More information about the macports-users mailing list