skip to primary navigationskip to content

MySQL database (Debian 8)

Database provided with Debian 8 (Jessie)

MySQL (v 5.5.47) is installed by default on MWS servers running Debian 8 (Jessie).

(MWS servers running Debian 9 (Stretch) have MariaDB 10.1.26).

On a new server you have access to a single user called 'root'. This user has a random password assigned to it which you can access or change from the panel ('Server Settings --> 'Change database root password'). MySQL can only be accessed from localhost. You should use the root MySQL user to create other MySQL users to control the databases you create for your application and content management systems.

The MWS does not provide graphical tools such as PHPMyAdmin, though you could install this yourself.

MySQL backups are stored in /snapshots/mws-snapshot-<year>-<month>-<day>/mysqldumps

If you forget your MySQL root password or you lock yourself out of MySQL, you can use the "Change database root password option" in the Control Panel.

The database has an additional user called 'debian-sys-maint'. This is used for routine database activities such as making database backus. Please do not delete or reconfigure this user.

If you have exported a database using an earlier version of MySQL, and import it into MySQL in your new MWS site, you should run the command

$ mysql_upgrade --force -u root -p

to update the database you have just imported. This is because the database will need to be updated to work correctly in the MySQL on the MWS.

When exporting databases from elsewhere, export (in sql format, not binary) the individual databases used by your website(s) and not all databases at once (if using mysqldump to export databases, do not use the "--all-databases" option). Importing all databases can overwrite the existing user table in MySQL on your new site.

The MySQL database on your MWS server is only directly accessible from that server. It listens on the normal Unix domain socket and on the TCP port localhost:3306. The TCP port can be used to establish an SSH tunnel, allowing administrators and ssh-only users to connect remotely to the site's MySQL server. For example after running

$ ssh -L 3307:

the database port on the MWS site will appear as port 3307 on the local machine and

$ mysql -h -P 3307

will correctly connect to the MWS site database. You will probably need to supply a username and password before such a connection will actually succeed.