[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cannot configure MySQL



On Tuesday 23 September 2008 17:34:44 Joseph Rawson wrote:
> On Tuesday 23 September 2008 16:46:00 Chris Lale wrote:
> > Hello.
> >
> > I am trying to build a Live CD containing a website delivered by Apache
> > using PHP and MySQL. My host system is running Lenny.
> >
> > I can create an image in which Apache2, PHP5 and MySQL are all installed
> > and behaving correctly. I want to configure MySQL in the image so that
> > there is already a root user password and an existing database.
> >
> > I created the initial image and ran it in VirtualBox. In VirtualBox I
> > successfully created a password for the MySQL root user and imported the
> > database from a .sql file. I tarred up /var/lib/mysql/ and /etc/mysql/ to
> > preserve ownership, and transferred them to config/chroot_local-includes/
> > on the host system using scp. I untarred them as root to preserve
> > ownership. The owner and group names still corresponded exactly with the
> > originals.
> >
> > I created a new image and mysqld failed to start. The problem may be that
> > some files have changed owners and groups in the image. Eg on the host
> > config/chroot_local-includes/var/lib/mysql/ibdata1 has owner "mysql-MySQL
> > Server" and group "mysql", but in the image /var/lib/mysql/ibdata1 has
> > owner "113" and group "118".
> >
> > It looks like the ids are being transferred during the build rather than
> > the names, and any particular id may have a different name on the host
> > and in the image.
>
> One of my VM's is running mysql
>
> > I would be grateful if anyone could think of a way around this.
>
> Run these as root in the VM:
oops, I'm forgetting that this is in the chroot, 
but after you transfer the files, run these commands in the chroot.
The user/group names will be resolved by the passwd/group files in the chroot
(unless you've messed with nsswitch.conf).
> chown -R mysql:mysql /var/lib/mysql
> chgrp root /var/lib/mysql/mysql*
> chgrp root /var/lib/mysql/debian-*.flag
>
> That should do the trick.
>
> > --
> > Chris.



-- 
Thanks:
Joseph Rawson

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: