Mysql – Is MySQL supposed to be installed alone

databaseMySQL

I often hear people making statements such as "our MySQL server machine failed", which gives me the impression that they dedicate a single machine as their MySQL server (I guess they just install the OS and only MySQL on it). As a developer not a sysadmin, I'm used to MySQL being installed as part of a LAMP stack together with the web server and the PHP.

Can someone explain to me:

  • what's the point of installing MySQL on a separate server? sounds like a waste of resources when I can add the entire lamp stack there and additional servers as well.
  • if the database is on a separate machine, how do the apps that need to use connect to it?

Best Answer

When your application platform and your database are competing for resources, that's usually the first indication that you're ready for a dedicated database server.

Secondly, high-availability: setting up a database cluster (and usually in turn, a load-balanced Web/application server cluster).

I would also say security plays a large role in the move to separate servers as you can have different policies for network access for each server (for example, a DMZ'ed Web server with a database server on the LAN).

Access to the database server is over the network. i.e. when you're usually specifying "localhost" for your database host, you'd be specifying the host/IP address of your database server. Note: usually you need to modify the configuration of your database server to permit connections/enable listening on an interface other than the loopback interface.

Related Topic