Aug 4, 2009

Install mySQL on Debian & Ubuntu and connecting to ColdFusion

Well since I got a mention on CFHour about my CF9/8 Debian install Michael mentions mySQL as part of the install and I figured I would add this to my screen capture. Debian and Ubuntu make this so easy.

Here is the original tutorial.

From that point you can follow on here:

apt-get install mysql-server mysql-client
vi /etc/mysql/my.cnf ( I use vi you can use any editor )

on line 47

comment out this line:
bind-address = 127.0.0.1

so it looks like this:
#bind-address = 127.0.0.1

This will allow remote connections from your host machine if you use a GUI tool to admin mySQL.

Restart the mySQL service:
/etc/init.d/mysql restart

Login to mysql from the cli:
mysql -u root -p
this will ask for your password can can optionally pass it as a parameter like so: mysql -u root -p password

Execute these 2 commands:
grant all privileges on *.* to root@"%" identified by "password";
flush privileges;

the % means root can log in from any IP address.

Now you should be able to connect to mysql from a separate machine.



On Windows I have been using Toad here is a quick walk through of connecting Toad to mySQL in the VM and then adding the new database as a datasource in CF9.

1 comments:

  1. Impressive being able to install a database server in 2 minutes. Lets see Microsoft pull that one off.
    ReplyDelete