Thursday, October 25, 2007

Connecting to a MySQL Server remotely

I've been working on a PHP code that uses MySQL DBs, and I've been doing it manually from Quanta and PHPMyAdmin. And everyone knows that coding in a browser is a very bad habit. I sure wish I have an IDE with MySQL Admin integrated in it. But before I go searching for that particular IDE, I wanted to make sure that I can access it from both my desktop and my laptop.

I'll be using MySQL Administrator for this tutorial and my MySQL server is hosted on Ubuntu Server Gutsy, subtle differences are expected (if any).

First, the error that'll show up would be this:

To determine if there's a firewall preventing access, try to ping it:

If you can't ping it, open port 3306

sudo iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

As I've said earlier, I have PHPMyAdmin installed, I used it to create 4 users for my laptop and my desktop. I made sure I have both the IP Address and Hostname in it. And since I wanted this to be an admin account, I granted it all privileges. Consult the help docs if you don't have PHPMyAdmin installed or if you want to do this manually.

Next up would be to edit /etc/mysql/my.cnf
Comment out bind =

Restart MySQL

And lastly, test it out:

I can now create, edit, and drop DBs/Tables from MySQL Administrator. I don't have any need for PHPMyAdmin now that I can access MySQL remotely so I removed it. I'll be searching for a PHP/MySQL IDE next.

Blogged with Flock

Tuesday, October 16, 2007

P3 733MHz Server and SSH

I badly need a multi-purpose server to hone my skills and host my site and my files. So I converted my old P3 733MHz into a server. Good thing it only consumes 19.1 Watts, that'll help a lot with my Power bill. After I installed Ubuntu Gutsy RC1, I disabled everything else... CD-ROM Drive, USB, etc. etc. etc. The only thing running right now is the CPU, PSU, and my trusty old 20GB Hard Disk Drive.

After two days of configuring it, I finally got my server running. Had to wait for my DNS entry to propagate though, but it worked well once I got it up and running. So far, it's been running for 3 days straight, and it's as fast and cool as ever. I might need to take it offline next year though to clean the dust.

And lastly, I need to have it running headless. So I installed OpenSSH-server, imported my key to the authorized_keys file and configured it to only accept logins from me. However, before getting it to work flawlessly, I encountered one problem... it won't allow me to login. I keep on getting Permission denied error.

How did I know I have a permission problem? I checked /var/log/auth.log and saw this line:

Oct 16 16:38:25 t2798 sshd[29599]: Authentication refused: bad ownership or modes for directory /home/dax/.ssh

Since I imported my /home from an old HDD, I forgot to check it's permission. SSH is very particular about permissions. I fixed it by issuing this command:

server$ chmod go-w ~/
server$ chmod 700 ~/.ssh
server$ chmod 600 ~/.ssh/authorized_keys

Blogged with Flock

Monday, October 01, 2007

Helping with Bugs

It is common knowledge that Ubuntu gets hundreds of Bug Reports daily. And currently, we have around 32K Open Bugs.

This is an invite to everyone fond of Ubuntu. Bug Reporting's one thing, but Triaging's another. Once a bug gets reported, it stays there. The Dev/Maintainer would be informed that he has an Open bug, and he may or may not choose to work on it. Sometimes, due to stress and workload, they don't even have the luxury of time to look at your report.

This is where Bug Triaging comes in. We mark duplicate bugs, ask for confirmation from users, and squeeze as much information from both users and reporters. Once we have everything we need, we mark it as Triaged and set the appropriate Priority. The dev/maintainer, no matter how busy he is, is now obligated to look into it. Fix it or replace the affected package with an updated one.

Of course, there will always be old bugs. Sometimes, we have Open Bugs as far back as 2005, and there's nothing we can do but close it and advise users to upgrade to the latest stable version.

This is how we control bugs. Join us, I know you'll have fun doing this.

Additional Resources:
Contribute to Ubuntu
Bug Responses
Bug Importance
How to Report Bugs
Effective Bug Reporting
Finding the Right Package
Getting Backtrace
Debugging Procedures

Blogged with Flock