-1

On my Windows 7 PC I have Virtual Box running a Centos VM that has PHP installed on it but no MySQL that I brought from the office.

I am trying to set up a database for it. I have Wamp installed on my PC and tried to connect to that database, but I couldn't get it working (I'm thinking since localhost on my PC would not necessarily be visible to the VM). Is there anything I can do to connect to that from a VM or is there a simpler solution to get a MySQL database set up that the VM can connect to?

3
  • Can you please elaborate on where you're trying to set-up that database? Is that inside the VM, or on the host OS? WAMP should come with MySQL, so I don't see why you want to jump through hoops. Commented Oct 15, 2012 at 4:16
  • Wamp is on the host OS (VM is linux which i am very unfamiliar with). Commented Oct 15, 2012 at 4:25
  • I posted this here because I put it on SO and was told it belonged here. Really dislike it when a question gets closed with no comments. Commented Oct 16, 2012 at 1:07

1 Answer 1

1

To install MySQL and other needed packages on CentOS (doesn't matter if it's a VM or physical), all you have to do is run

sudo yum install mysql-server php-mysql 

This will install MySQL server and a php library to talk to it and any missing dependencies for it.

2
  • noice. i kind of want to keep mysql separate from the VM .. is there an easy way to do that? Commented Oct 15, 2012 at 5:22
  • If you still want to keep MySQL on your host machine, then 1st you need to make sure that your VM is allowed to communicate over network with your host. Next you need to make sure that your MySQL/WAMP is configured to listen on your LAN IP and not just on 'localhost'. Commented Oct 15, 2012 at 5:25

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.