It appears that you want a failover feature.

MySQL offers:

Replication: setup two hosts (1 master & 1 slave). All data is written to the master and the slave replicates the data. Now if the master fails, the slave does NOT take over, but you do have a copy of all your data unharmed.
(You could create a few simple shell scripts where if the IP of the master fails, have the slave change IP address...)
http://dev.mysql.com/doc/refman/5.0/en/replication.html

Clustering: setup 3 or more hosts (1 server to manage the cluster, 1 master and 1 node). All data is written to the master then to the slave. If the master fails then the node automatically takes over.
http://dev.mysql.com/doc/refman/5.0/en/ndbcluster.html