0% found this document useful (0 votes)
48 views

Examples:: Phpinfo

This document provides information about PHP and MySQL configuration and connections. It lists phpinfo for viewing PHP configuration, phpMyAdmin for administering MySQL, and sample connection code using host/port or socket to connect a MySQL database as the root user with the root password. It also gives examples of PHP and scripting language versions.

Uploaded by

Héctor Olvera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Examples:: Phpinfo

This document provides information about PHP and MySQL configuration and connections. It lists phpinfo for viewing PHP configuration, phpMyAdmin for administering MySQL, and sample connection code using host/port or socket to connect a MySQL database as the root user with the root password. It also gives examples of PHP and scripting language versions.

Uploaded by

Héctor Olvera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

PHP

phpinfo shows the current configuration of PHP.

MySQL
MySQL can be administered with phpMyAdmin.

To connect to the MySQL Server from your own scripts use the following connection parameters:
Host localhost
Port 3306
User root
Password root
Socket /Applications/MAMP/tmp/mysql/mysql.sock

Examples:
 PHP <= 5.5.x
 PHP >= 5.6.x
 Python
 Perl

$user = 'root'; $password = 'root'; $db = 'inventory'; $host = 'localhost


'; $port = 3306; $link = mysql_connect( "$host:$port", $user,
$password ); $db_selected = mysql_select_db( $db, $link );

or using an UNIX Socket:

$user = 'root'; $password = 'root'; $db = 'inventory'; $socket = 'localho


st:/Applications/MAMP/tmp/mysql/mysql.sock'; $link = mysql_connect( $
socket, $user, $password ); $db_selected = mysql_select_db( $d
b, $link );

You might also like