Name

mysql_connect

Synopsis

msql_connect($hostname);
mysql_connect($hostname);
mysql_connect($hostname, $username);
mysql_connect($hostname, $username, $password);

Creates a connection with the mSQL/MySQL database server at hostname. A connection to the server on the local host is made with m(y)sql_connect(“localhost”). If no connection exists at the time of the first call to m(y)sql, a connection is automatically made to the localhost. With MySQL an optional username or username/password combination may be given. If PHP is being run in its enhanced security mode (called SAFE MODE), the username must be either the owner of the HTML document or the owner of the web server process.

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.