I'm scared of MySQL

Photo taken by me!

I've been using PHP for a bit over a year and half. It's come to my conclusion, that I've never used MySQL in any of my applications. I think I'm scared of reliance.

I tend to use either a simple flat file (like WorkSimple) or pjjTextBase (Torrentino for example) because they're quite easy to manipulate. I'm not sure why I don't use MySQL, being PHP's soul. Everything you see nowadays for PHP uses MySQL.

None of my applications use MySQL (or anything that is 'modern'). Hell, Sysode, Torrentino and Ticketo (my larger projects) all use PTB. Plus, flat file is faster. Skip the middleman, and write directly to the file system. Additionally, I tend to keep my projects/scripts small.

Maybe it's just me, but I think that MySQL (or PostgreSQL) is overkill for some applications. Take doobleg for example. Simple 9 column database. On the other hand, Sysode uses 6 different DB's.

The terrible thing about flat file databases is scalability. Ugh, shoot me before I have to scale a single file.

Then again, SQLite seems pretty cool, I might check that out. I think TPB use(d) SQLite.


On another note, I fixed up Sysode and I think I might purchase a domain; considering sysode.com/info/net/org are all available ;)





How to: Use seperate local MySQL DB

This was quite frustrating for me. I tried everything; why doesn't it connect to to the database? I finally figured it out: wrong IP. Anyway, here are some tricks that I used to get Server A to connect to Server B, with MySQL.

First things first. Change your bind-address. For Debian, edit your my.cnf in /etc/mysql
Change the bind-address to your local LAN IP. Restart MySQL with:


/etc/init.d/mysql restart



Now to tackle MySQL...


mysql -u root -p

Create the user and assign privileges:

Note, should be the clients IP, not the servers.

CREATE USER 'user1'@'' IDENTIFIED BY 'pass1';


GRANT ALL ON *.* TO 'user1'@'';

And finally create the database:

create database databasename;

 I'm no SQL guru, so please correct me if I messed up ;)

Hope that helps!