Being a brave sys-admin I do backup my mysql databases. But, begin to lazy to give each of my databases his own backup-script, I backup all the databases in one dump.
Sofar (triple knock on wood) I had only once to restore a database from that file. I did a couple of greps on the large file to create a file with only the database to restore. But Mike Hillyer has an excellent tip on his blog. I wonder when that option (-one-database) has been introduced, because it’s the first time I’ve heard of that option.
But here is the procedure:
Start my launching mysql client with –one-database
mysql -u root -p –one-database mydatabase
Then use the SOURCE command:
source ~/multidatabase.sql
The –one-database option forces the mysql client to ignore statements intended for any database other than the one you specified when you launched the client, allowing you to restore your database without affecting any other databases.
Posted by:
Merlijn on Wednesday, 21 of September , 2005 at 21:44
Tags:
MySQL Categories:
Coding
Comments:
be the first (opens in a pop-up window)
Add this post to
del.icio.us or
digg it
While coding (php5) on a new project today, I found myself struggling with the question to fit a collection of functions in a class or not. Or in other words, to maintain a procedural style, or more object orientated.
I only learned recently how to use objects and classes in php5 and I find myself mixing objects and procedural style within scripts. For instance, html templates and database abstraction is fitted in classes, while handling a form (collection -> validating ->processing) is done in a procedural style in my scripts.
I think that webapplication-coding is by nature more suitable for a procedural style. You have a very clear starting point and end. So the timeline in your script is very linear. Compare this with java, where applets mostly run in a loop waiting for userevents. The fundamental difference in nature (begin->end against looping) explains my struggle to code completely OOP with PHP.
Off course OOP has lots of advantages with PHP (execption handling, code reusability to name a few) but I think when coding webapplications, you will always find yourself coding a more or less procedural timeline within your script.
Posted by:
Merlijn on Wednesday, 31 of August , 2005 at 22:13
Tags:
oop,
PHP,
web 2.0 Categories:
Coding
Comments:
be the first (opens in a pop-up window)
Add this post to
del.icio.us or
digg it
Doing PHP development for several years now, I never really understood version control and how to integrate it with my web-application development. For “traditional” programming, it is clear. You create a repository, all the developers keep in sync and commit their updates. But being the whole development team yourself and have code that for 100% depends on the database stopped me from even try to set up a version control system.
Until last week. I just finished a project and was starting a new one, when I decided that this was the ideal moment for fiddling around with version control. I happened to have a golden oldie compaq proliant 1850R with RAID 5 disks AND a fresh install of freeBSD 5.4. Ideal for the task of becoming a CVS server….eh… cvs? subversion?
Being a total version control newbie, I did my googling and reading.
In one sentence: CVS is old and insecure, Subversion is hot and the talk of the town. CVS compares to Subversion as telnet to ssh.
And the fun thing? installing and setting up took me 1,5 hour. Using ports
there are basically two ports to install: Apache2 and Subversion.
Below are links to the pages I used for setting up my subversion server, but here are some hints/notes: (not a howto or tutorial! read the pages!)
Create a svn user and group, and adjust the umask of that user. I used: umask 002.
Build apache2 with WITH_BERKELEYDB=db42.
I have changed httpd.conf to have apache2 runs as svn user and group, this spares you from read/write issues when using Subversion with webdav.
Build Subversion with -DWITH_SVNSERVE_WRAPPER -DWITH_MOD_DAV_SVN.
Su -l to the SVN user, create the repository and import your initial project layout, confiure apache to serve the repository with webDAV and…you’re free to go!
It kicks ass!
I do my webdevelopment on my mac offcourse and I found svnX to be a fantastic client wrapper. 2, 3 hours after installing and setting up my first version control, I found myself wondering how I ever lived (eh..ok developed) without it.
The links I used:
onlamp - Setting up a Secure Subversion Server
the SVN book (free!)
macdev center- making the jump to subversion
onLamp - top ten tips for Subversion users
OS X Subversion client package (you need this for being able to use a gui front-end as svnX.
svnX
Versions Systems link collection
And because I always forget the exact procedure:
Apache+SSL on freeBSD
Recent addition is this article from RedHat, a introduction suited for both CVS users and those new to version control.
CVS is out, Subversion is in found with digg.com
Posted by:
Merlijn on Saturday, 20 of August , 2005 at 10:42
Tags:
freeBSD,
PHP,
subversion Categories:
Coding,
freeBSD
Comments:
be the first (opens in a pop-up window)
Add this post to
del.icio.us or
digg it
This is an amazing java-applet.
Especially because it is unbelievable fast. And it’s always fun to look up your own name…Apperently mine dropped from the top 100 during the 70’s.
What surprised me was the popularity of my name during the 1930’s.
Other fun names are: Bessie (name your daughter as a cow) and Xander (the Buffy effect).
The url to the java-applet: http://www.babynamewizard.com/namevoyager/
Posted by:
Merlijn on Friday, 29 of July , 2005 at 09:57
Tags:
babynames,
java,
web 2.0 Categories:
Coding,
General
Comments:
be the first (opens in a pop-up window)
Add this post to
del.icio.us or
digg it
For my Open University course I have started with “Visual Programming with Java”.
I know it’s more fun as Discrete Math :)
And it’s quite fun to finally “learn” programming, as I’m a autodidact. The level is very very basic, but that doesn’t matter to me. In the last years my experience is that it can be very helpfull to really learn the basics.
The real fun is that I have to use windows again. The course uses Borland Jbuilder 8, with a license which only runs on windows XP according to the manual, but I use it on my very old windows98 machine without any problems.
And oh boy, what is an IDE fun. Programming like playing with LEGO.
“You have forgotten a semi-colon right here”.
Oh…thanks :)
Instead of digging through 2500 lines of code where that missing T_SPACE is…
Java is also fun to work with. Very straightforward and easier than C (no memory management / garbage collection needed). I really can tell know where PHP has it’s roots. It really helps me getting some insight in OOP concepts, which are used in PHP 5 as well.
btw…writing this on windows, Wordpress really looks better in Firefox as in Safari…damn.
Posted by:
Merlijn on Saturday, 23 of July , 2005 at 13:53
Tags:
java,
oop,
open university,
PHP Categories:
Coding
Comments:
3 » (opens in a pop-up window)
Add this post to
del.icio.us or
digg it