Database

From VUB Hosting
Revision as of 09:58, 28 March 2018 by Brdooms (talk | contribs) (Database (EN))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Database (EN)

A single database user account and password is provided per hosting instance. These credentials provide access to our MariaDB (MySQL) server.

MySQL test file mytest.php

Within your home directory, a file called "mytest.php" is provided. This file will check the following:

  1. mytest.php script will test the connection with the database server and will show the database tables. If there is an error, the script will provide the error message.
    Note: the mytest.php script is placed outside the "www" directory. It may be tested in your brwoser by copying (or symlinking) it to the "www" directory.
    alternatively, you can run the script on the command line like so:
     $ php mytest.php 
  2. within the script, 4 constants are defined:
    • database host
    • database user
    • database name
    • database password

Since the creation of the mytest.php script is automated, it will contain an updated version of the database credentials.

Database (NL)

Er is per hosting account één user met bijhorend wachtwoord voorzien die toegang heeft tot een database op onze MySQL server (technisch gesproken geen MySQL, maar MariaDB).

MySQL test file mytest.php

In uw home directory staat een bestand "mytest.php". Dit bestand heeft twee nuttige functies.

  1. mytest.php test of de database bereikbaar is, en geeft het aantal tabellen weer. Of een foutmelding indien er wat fout loopt.
    let op: mytest.php staat niet in de "www" directory. Om het aan te roepen via de browser, moet het dus naar de "www" directory worden gekopiëerd of gelinkt (m.b.v. een symbolishe link).
    het alternatief is het script op de command line aan te roepen:
     $ php mytest.php 
  2. in dit script zijn 4 constanten gedefiniëerd nl:
    • database host
    • database user
    • database naam
    • wachtwoord

Aangezien mytest.php door ons configuratiebeheer automatisch wordt gegenereerd, bevat het altijd een up to date versie van de database coördinaten.