[Solved] ubuntu guest mysql problem

Discussions related to using VirtualBox on Windows hosts.
Post Reply
paolocollector
Posts: 11
Joined: 17. Jul 2009, 15:46
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: linux ubuntu

[Solved] ubuntu guest mysql problem

Post 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
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: ubuntu guest mysql problem

Post by vbox4me2 »

Shared folders are not suitable for such use, its a basic file transfer system and thats all, use samba instead.
paolocollector
Posts: 11
Joined: 17. Jul 2009, 15:46
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: linux ubuntu

Re: ubuntu guest mysql problem

Post by paolocollector »

Thanks for the anwer.
Can you please direct me on some docs how to use samba in virtualbox?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: ubuntu guest mysql problem

Post by vbox4me2 »

Samba is a linux module that connects to windows file sharing, use google.
paolocollector
Posts: 11
Joined: 17. Jul 2009, 15:46
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: linux ubuntu

Re: ubuntu guest mysql problem

Post 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.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: ubuntu guest mysql problem

Post by vbox4me2 »

You make a share and attach to it, just like on real hardware.
paolocollector
Posts: 11
Joined: 17. Jul 2009, 15:46
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: linux ubuntu

Re: ubuntu guest mysql problem

Post 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.
paolocollector
Posts: 11
Joined: 17. Jul 2009, 15:46
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: linux ubuntu

Re: ubuntu guest mysql problem

Post 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
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: ubuntu guest mysql problem

Post by vbox4me2 »

If you can ping it you see its IP.
paolocollector
Posts: 11
Joined: 17. Jul 2009, 15:46
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: linux ubuntu

Re: ubuntu guest mysql problem

Post 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
paolocollector
Posts: 11
Joined: 17. Jul 2009, 15:46
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: linux ubuntu

Re: ubuntu guest mysql problem

Post 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
Vacilando
Posts: 2
Joined: 1. Jun 2014, 21:43

Re: [Solved] ubuntu guest mysql problem

Post by Vacilando »

It actually is possible to move MySQL datadir to a shared folder, see: http://vacilando.org/en/article/moving- ... red-folder
Post Reply