Page 1 of 1

[Solved] ubuntu guest mysql problem

Posted: 29. Oct 2009, 23:44
by paolocollector
Hi
i have installed ubuntu as a guest on my xp host.
It all works fine, shared folder as well.
However I can't use a mounted shared folder as mysql data folder.

I followed some instructions i found on the net, here is what i have done:

Code: Select all

mount -t vboxsf -o uid=113,gid=123,dmode=700,fmode=660 mysql /var/database/mysql
/etc/init.d/mysql stop
/etc/init.d/apparmor stop
vi /etc/mysql/my.cnf
  -- changed datadir into /var/database/mysql
vi /etc/apparmor.d/usr.sbin.mysqld
  -- added   /var/database/mysql/ r,
             /var/database/mysql/** rwk,

cp -p -r /var/lib/mysql/* /var/test/mysql/
/etc/init.d/apparmor start
/etc/init.d/mysql start
(the mount mounts for user mysql and files have the same permissions as the original /var/lib/mysql files)

However if i try to create a table as

Code: Select all

CREATE TABLE `archiva`.`test` (
  `name` TEXT  NOT NULL
)
ENGINE = MyISAM;
I receive this error:
Error executing SQL commands to create table.
MySQL Error Nr. 1033
Incorrect information in file: './mytestdb/test.frm'
If I do the same things in a directory that is not mounted (eg creating a new one) all works fine, so I know that the procedure is correct.

Any idea why a shared folder from windows should make mysql not working properly?

Thans
Paolo

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 09:51
by vbox4me2
Shared folders are not suitable for such use, its a basic file transfer system and thats all, use samba instead.

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 11:53
by paolocollector
Thanks for the anwer.
Can you please direct me on some docs how to use samba in virtualbox?

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 12:02
by vbox4me2
Samba is a linux module that connects to windows file sharing, use google.

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 12:18
by paolocollector
I know what samba is.
I meant: how can I use samba in ubuntu client windows host in virtualbox?
I searched the forum for this topic but i cant find any ref.

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 12:24
by vbox4me2
You make a share and attach to it, just like on real hardware.

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 13:15
by paolocollector
Right.
How can i find out the network name or ip address of my windows host?
I have configured two network adapter, the first is the default NAT adapter and the second one is an Host-only.
I can see the ubuntu client from windows, i can ping it etc, but i dont understand how can i see my windows host from ubuntu.

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 13:32
by paolocollector
I explain it a bit better:
if i run
smbclient -L paolopc
i can see my folder "mydb" available
but the command
sudo mount -t smbfs //paolopc/mydb /var/testmount
results in

mount error: could not resolve address for paolopc: No address associated with hostname
No ip address specified and hostname not found

So I think that mount might want the ip address instead of the host name, but i dont know how to find it

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 14:04
by vbox4me2
If you can ping it you see its IP.

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 16:43
by paolocollector
Thanks for help, it works now if i am connected to the lan at work.
In that case i can use the ip assigned to my windows host.

However if i disconnect the cable, i can't ping it anymore at that address.

This makes sense, but i was wondering if there is another way to see the host from the guest without having a network.
It would make sense that i can do it, but i dont know which address is assigned to the host

Re: ubuntu guest mysql problem

Posted: 30. Oct 2009, 17:50
by paolocollector
Eventually i found my answer: it wasn't reported in the user guide so it took a while
the host address is 192.168.56.1
with that one i can di the mount properly
Thanks
Paolo

Re: [Solved] ubuntu guest mysql problem

Posted: 3. Jun 2014, 16:40
by Vacilando
It actually is possible to move MySQL datadir to a shared folder, see: http://vacilando.org/en/article/moving- ... red-folder