Database: Difference between revisions

From CSCWiki
Jump to navigation Jump to search
(Initial commute: WIP on database documentation)
 
(Add port)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
'''IMPORTANT NOTE: This documentation is currently under development. Please see [[MySQL]] for current database information.'''
'''IMPORTANT NOTE: This is an upgraded database service offered by the CSC. It is not currently available to members, please see [[MySQL]] for current database information.'''


The CSC provides MySQL and Postgres databases to members.
The CSC provides MySQL and Postgres databases to members.
Line 5: Line 5:
If you want to run something different (e.g., MongoDB), you can compile/run it yourself. '''Please''' stay up to date with security updates and '''DO NOT''' run it on a port open to the internet (see [[Firewall|Firewall]]).
If you want to run something different (e.g., MongoDB), you can compile/run it yourself. '''Please''' stay up to date with security updates and '''DO NOT''' run it on a port open to the internet (see [[Firewall|Firewall]]).


Database services are provided on [[Machine_List#coffee|coffee]].
Database services are provided on [[Machine_List#coffee|coffee]], through port 3306.


== Servers ==
== Servers ==


=== MySQL ===
=== MySQL ===



=== Postgres ===
=== Postgres ===

Latest revision as of 15:25, 28 August 2022

IMPORTANT NOTE: This is an upgraded database service offered by the CSC. It is not currently available to members, please see MySQL for current database information.

The CSC provides MySQL and Postgres databases to members.

If you want to run something different (e.g., MongoDB), you can compile/run it yourself. Please stay up to date with security updates and DO NOT run it on a port open to the internet (see Firewall).

Database services are provided on coffee, through port 3306.

Servers

MySQL

Postgres

Connecting

MySQL

PHP

To connect to MySQL from PHP, you need to specify the SSL Cipher of 'DHE-RSA-AES256-SHA:AES128-SHA'. For PHP PDO:

 $pdo = new PDO('mysql:host=coffee.csclub.uwaterloo.ca;dbname=DBNAME', 'USERNAME', 'PASSWORD', [
   PDO::MYSQL_ATTR_SSL_CIPHER => 'DHE-RSA-AES256-SHA:AES128-SHA'         
 ]);                                                                      
 $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);