0

Here is the template for connecting to a DB through DBI:

 $dbh = DBI->connect($data_source, $username, $password)
        or die $DBI::errstr;

and here is how $data_source is described:

dbi:DriverName:database=database_name;host=hostname;port=port

My understanding is that host + port identifies an instance of a mysqld process containing multiple schemas, and that a schema contains tables. Where, then, in this heirarchy, is a "database"? Sometimes it seems the word "database" refers to the mysqld instance, and other times to a schema.

UPDATE 1: Is it ever correct to refer to the "server" (e.g. a daemon process -- NOT a piece of hardware) to which clients connect on a TCP/IP port and send SQL requests as a "database"? If not, what is it called?

Chap
  • 3,649
  • 2
  • 46
  • 84
  • 4
    MySQL calls schemas "databases". Why? Perhaps because if MySQL ever actually got anything right, it wouldn't be MySQL anymore. – hobbs Mar 01 '13 at 00:51
  • Our company does about 30M$/year using MySQL to manage a direct marketing cooperative database, several tables of which contain between 100 million and 3.5 billion rows - what is it that it doesn't get right? – Chap Mar 01 '13 at 04:05
  • What doesn't it get right? There are a few things listed here for a start - http://use.perl.org/use.perl.org/_Smylers/journal/34246.html – Dave Cross Mar 01 '13 at 09:22

1 Answers1

0

Perl::DBI can connect to many different venders' databases. So the terms will vary, depending on which DB you are connecting to. Some call it a schema, others call them databases.

For UPDATE1: I'm assuming you mean the mysql.sock file? See the mysql_socket option, explained here: How do I tell DBD::mysql where mysql.sock is?

Community
  • 1
  • 1
Jim Black
  • 1,422
  • 1
  • 13
  • 26