MYSQL VirtualBox
I just downloaded a fresh Ubuntu desktop iso 10.10 (wanted to install server but not 100% supported in virtual box) and I following some instructions from the website to create my server http://www.munkyonline.com/articles/lamp-ubuntu-server-on-virtualbox
VirtualBox Drivers
First thing I did was install Guest Additions. I like the bigger screen.
Install of MySQL server looks like it installed OK but what is the password to log-in? why it did not ask me to provide a password? so with some Google help:
sudo mysql
mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> WITH GRANT OPTION;
mysql> CREATE USER 'admin'@'localhost';
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> CREATE USER 'dummy'@'localhost';
Note if you did provide a password for the root user during the install of MySql here is how you log-in to add more users:
sudo mysql -u root -p
how do I connect to my Guest machine from my Host machine or the network?
The advice below kind of works but after hours of trying i could not connect from other machines in the network so I new there had to be an easier way.
Control Panel, select the Network and Sharing Center and then in the top left menu should be a link to ‘Change Adapter Settings’. There you will see your Windows 7 Local Area Connection and also a VirtualBox Host-Only Network connection, using your mouse select both icons, right-click and select ‘Bridge Connections’. Now return to VirtualBox, select your newly created virtual machine and click ‘settings’. Under Network and the Adapter 1 tab change the ‘Attached to’ setting to ‘Bridged Adapter’ and then in the ‘Name’ dropdown select your bridged network connection, click OK.
If you just want Ubuntu to provide a web-server and/or MySQL then use port forwarding in VirtualBox so I will forward port 8888 to my tomcat server in ubunt port 8080 and i will forward port 3333 to my MySQL server 3306
Next you need to change the bind address in the “my.cnf” file:
sudo gedit /etc/mysql/my.cnf
Look for the line which contains ‘bind-address’ and change it to your static IP or remove it by making it into a comment for a dynamic IP (like i did):
bind-address = 192.168.1.85 #bind-address = dynamic
And that should be it. I hope this post will help some one.
April 20, 2011
|
Posted by Ozkey

Categories: