5

Is there a limit of the number of databases a single MySQL server can handle?

Luke
  • 3,756
  • 7
  • 35
  • 39

3 Answers3

5

I'm unable to find any record of MySQL having a limit in the documentation.

If you're using MyISAM, you may run into a limit on the number of open file handles you can have as it uses several files per table. You can raise this using ulimit. InnoDB normally uses one file for all databases and two for database journal logs, but you still have one metadata file per table so this shouldn't be so much a problem unless you've configure InnoDB to do one file per table.

Regardless of open file handle limits, you'll find practical limits due to filesystem performance with many files in a directory structure, but we're talking several thousand in the same directory. If you get to this point, you're doing something very wrong.

David Pashley
  • 23,151
  • 2
  • 41
  • 71
2

I don't know the exact limit, but you'll run out of system resources long before you'll run out of databases. I've seen installations with 500+ databases.

I've even seen multiple instances of mySQL with multiple databases running.

Now, whether the client SHOULD have had 500 databases on that system is a totally different question. LOL!

The hardware you run on is definitely going to be a determining factor.

Hope this helps.

KPWINC
  • 11,274
  • 3
  • 36
  • 44
2

I have never come across a hard limit to the number of databases one on server, it will depend on the size and the traffic of each of the databases, I have certainly had single servers with in excess of 2000 databases, however the databases were only used by a handful of students at any one time.

Richard Slater
  • 3,228
  • 2
  • 28
  • 42
  • My situation is quite similar in that I have a lot of databases but they are not used intensely. – Luke Jun 06 '09 at 21:49