I just installed Ubuntu 11.04 on a machine that I was using as a shared XBMC database server. It was the same machine that I was using before. I backed up the database and restored it on the new machine, but when I went to use XBMC it wouldn’t connect to my shared database. I tried doing the following from a XBMC machine:
ERROR 2003 (HY000): Can't connect to MySQL server on '###.###.###.###' (111)
After a bit of time on Google I found the solution. It appears that they changed the security in the latest version of MySQL. It used to be a setting called skip_networking which had to be set to off, they have since added the bind-address setting in the MySQL my.cnf file.
sudo nano /etc/mysql/my.cnf |
sudo nano /etc/mysql/my.cnf
You will need to find the bind-address setting and comment it out. Save and exit the file, and then restart MySQL.
sudo /etc/init.d/mysql restart |
sudo /etc/init.d/mysql restart
After that I could connect to the remote database, which was on my LAN. Please note that should take care to make sure that your server isn’t accessible from the outside, e.g. stay behind a firewall.
I have a new install of Ubuntu 11.04 beta installed on a machine, and I wanted to use it to do some web development, so I needed to install Apache2 with PHP5 and MySQL. All I needed to do was run a simple command.
sudo apt-get install mysql-server mysql-client apache2 php5 libapache2-mod-php5 |
sudo apt-get install mysql-server mysql-client apache2 php5 libapache2-mod-php5
You’ll then need to restart apache to get php working.
sudo /etc/init.d/apache2 restart |
sudo /etc/init.d/apache2 restart
You may view you phpinfo by editing a file in /var/www/
sudo gedit /var/www/info.php |
sudo gedit /var/www/info.php
add the following to the info.php.
Now visit http://localhost/info.php to view your php info. You may also want to add additional things to php5. You may search the repository using
sudo aptitude search php5 |
sudo aptitude search php5
Then once you found what other things you’d like to have installed you may do so by entering something like
sudo aptitude install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json |
sudo aptitude install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json
Usually I need to have mod_rewrite enabled for my applications to work.
Finally you may want to install phpmyadmin for working with your MySQL databases
sudo apt-get install phpmyadmin |
sudo apt-get install phpmyadmin