I can't initialise the database

Bug #21770 reported by mickael ROYER
8
Affects Status Importance Assigned to Milestone
mysql-dfsg-4.1 (Ubuntu)
Fix Released
Medium
Tollef Fog Heen

Bug Description

Hi,

I can't use mysql-server.
When I install mysql-server, the configuration fails (mysqld start fails).
The problem is that the initialisation of the database had failed
(mysql_install_db) with the error :
ERROR: 1 Can't create/write to file './mysql/db.frm' (Errcode: 13)
This error is always reproductible.

I don't have the problem with mysql-server-4.1 (that I use for the moment :)

Revision history for this message
Matt Zimmerman (mdz) wrote :

ls -l /var/lib/mysql

Revision history for this message
mickael ROYER (mickael-royer) wrote :

(In reply to comment #1)
> ls -l /var/lib/mysql
>

after the install of mysql-server :
  ls -l /var/lib/mysql :
     ...
     drwxr-xr-x mysql root mysql
     ...

  ls -l /var/lib/mysql/mysql :
     total = 0
Even if I do "sudo chmod -R 777 /var/lib/mysql", I have the same error when I do
"mysql_install_db".

after the install of mysql-server-4.1
  ls -l /var/lib/mysql :
     ...
     drwxr-xr-x mysql root mysql
     ...

  ls -l /var/lib/mysql/mysql :
     -rw-rw---- 1 mysql mysql 8820 2005-09-16 18:17 columns_priv.frm
     -rw-rw---- 1 mysql mysql 0 2005-09-16 18:17 columns_priv.MYD
     -rw-rw---- 1 mysql mysql 1024 2005-09-16 18:17 columns_priv.MYI
     -rw-rw---- 1 mysql mysql 9178 2005-09-16 18:17 db.frm
     -rw-rw---- 1 mysql mysql 0 2005-09-16 18:17 db.MYD
     -rw-rw---- 1 mysql mysql 1024 2005-09-16 18:17 db.MYI

I really don't understand :(

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #2)
> (In reply to comment #1)
> > ls -l /var/lib/mysql
> >
>
> after the install of mysql-server :
> ls -l /var/lib/mysql :
> ...
> drwxr-xr-x mysql root mysql
> ...
Could you please copy the exact output? This doesn't look right.

Revision history for this message
mickael ROYER (mickael-royer) wrote :

(In reply to comment #3)

> Could you please copy the exact output? This doesn't look right.
>

ls -l /var/lib/mysql
  -rw-rw---- 1 mysql mysql 25088 2005-09-17 10:06 ib_arch_log_0000000000
  -rw-rw---- 1 mysql mysql 10485760 2005-09-17 10:06 ibdata1
  -rw-rw---- 1 mysql mysql 5242880 2005-09-17 10:06 ib_logfile0
  -rw-rw---- 1 mysql mysql 5242880 2005-09-17 10:06 ib_logfile1
  drwxr-xr-x 2 mysql root 4096 2005-09-17 10:06 mysql
  drwxr-xr-x 2 mysql root 4096 2005-09-17 10:06 test

ls -l /var/lib/mysql/mysql
  total 0

ls -l /var/lib/mysql/test
  total 0

Revision history for this message
Tollef Fog Heen (tfheen) wrote :

Can you please run mysql_install_db by hand (as root) and see if that fixes the problem?

If that gives you an error, please run it under strace and attach the log here?

Revision history for this message
mickael ROYER (mickael-royer) wrote :

Created an attachment (id=3928)
the result of "strace mysql_install_db" executed in root

I attached the result of the command : "strace mysql_install_db"
I always have the same error.

Revision history for this message
Alain Perry (alain-perry) wrote :

(In reply to comment #6)
> Created an attachment (id=3928) [edit]
> the result of "strace mysql_install_db" executed in root
>
> I attached the result of the command : "strace mysql_install_db"
> I always have the same error.

I have the exact same problem on a breezy ppc system. Not that it really matters
here but I have noticed the same problem on a debian testing x86 system, so this
is probably not ubuntu specific. When doing a fresh install of mysql-server, it
fails to start with the exact same problem, ie not being able to initialize the
database.

Revision history for this message
Dave (david-collett) wrote :

Hi all,
The strace attached is not usefull, as it does not follow the mysqld invocation.
Here is the relevant except from an strace I did:

[pid 15901] access("./mysql/db.frm", F_OK) = -1 ENOENT (No such file or directory)
[pid 15901] open("./mysql/db.frm", O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0660) = 5
[pid 15901] write(5,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
[pid 15901] _llseek(5, 64, [64], SEEK_SET) = 0
[pid 15901] write(5, "//\0", 3) = 3
[pid 15901] write(5, "\0 \0\0", 4) = 4
[pid 15901] _llseek(5, 0, [4096], SEEK_END) = 0
[pid 15901] write(5,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
[pid 15901] pwrite64(5,
"\376\1\7\t\3\0\0\20\1\0\0000\0\0\276\1\231\0\0\0\0\0\0"..., 64,
18446744073692708607) = -1 EINVAL (Invalid argument)
[pid 15901] close(5) = 0
[pid 15901] unlink("./mysql/db.frm") = 0
[pid 15901] write(2, "ERROR: 3 Error writing file \'./"..., 60ERROR: 3 Error
writing file './mysql/db.frm' (Errcode: 22)
) = 60

As you can see, the problem is not opening the file. The problem is the pwrite64
call with a bogus offset (looks like a 64bit negative number).
Google led me to this 1999 mysql bugreport:
http://lists.mysql.com/mysql/13888

Perhaps config needs to be changed before compilation. This sounds like a
work-around more than a fix, LFS support should work, maby it is an upstream
problem.
I worked around this for now by install mysql-server-4.1 from universe which is
not affected by this bug.
Dave
PS: My System is a mac mini (G4) running Breezy final

Revision history for this message
Tollef Fog Heen (tfheen) wrote :

I am able to reproduce this bug, but I wasn't able to track down why it happens before breezy released. I would recommend just using mysql-server-4.1 instead of mysql-
server, since this does not exhibit the problem.

Revision history for this message
markov (j-glisse) wrote :

What is the current status of this bug ? Anyone working on it ?
Do you need more information ? If so what you need ?

Revision history for this message
Tollef Fog Heen (tfheen) wrote :

It's only a problem in mysql 4.0, but we've moved to 4.1 now (in dapper). Closing this bug.

Revision history for this message
markov (j-glisse) wrote :

I have the same bug with ubuntu 5.10 The Breezy Badger on ppc G5.
So i don't think it is fixed at all.

Revision history for this message
markov (j-glisse) wrote :

Ok daper is next release. Can i get 4.1 with the 5.10 ?

Revision history for this message
Adam Conrad (adconrad) wrote :

You can install mysql-server-4.1 from universe. Not the best "solution", but
this PowerPC-specific problem was just something we ran out of time to tackle
for breezy.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.