SourceForge.net provides MySQL database services on an opt-in basis.
These database services may be used for a variety of things, including:
We encourage developers new to MySQL to familiarize themselves with the MySQL manual. Since the database servers are shared among many projects, appropriate application performance tuning should be performed by the project to avoid impacting other projects.
Service is based on MariaDB 10.6 on the x86_64 architecture and supports standard features, with the following caveats:
Project teams can access the database using the "MySQL Database" link in the left sidebar of the project's Admin page.
You can also find the hostname, username and password for the database
MySQL service is split into database servers based on the first letter of the project's UNIX name. This will be denoted as LETTER in the following documentation.
The hostname for our MySQL server is mysql-LETTER
For example, if the project's UNIX name is "leaf", the LETTER value for this project would be "l".
The MySQL database server for the leaf project is mysql-l.sourceforge.net.
NOTE: If you are connecting from the project web space or shell service the trailing .sourceforge.net should not be used.
phpMyAdmin is provided as an easy-to-use web-based interface to your MySQL database.
Project MySQL databases may also be accessed from Project web and via the Shell service
<?php
function OpenConn()
{
$dbhost = "Hostname";
$dbuser = "User";
$dbpass = "Password";
$db = "DatabaseName";
$conn = new mysqli($dbhost, $dbuser, $dbpass,$db) or die("Connect failed: %s\n". $conn -> error);
return $conn;
}
function CloseConn($conn)
{
$conn -> close();
}
?>
mysql -h HostName -u UserName -p
To ensure the database namespace is unique for each project, databases created by a project all use a project-specific prefix. This prefix uses a combination of the LETTER and the group ID for the project, in the form {LETTER}{GROUP ID}_*
Multiple databases may be created by a project.
Continuing our example: Since the "leaf" project's group ID is 13751, their database names would be prefixed by: l13751_
The leaf project can create multiple databases as needed, such as l13751_cmsdata and l13751_apptest.
The admin user is used to create new databases for your project.
Each project is provided three database users, each with a specific level of permissions.
User: Permissions
{LETTER}{GROUP ID}ro Read-only (SELECT)
{LETTER}{GROUP ID}rw Read/write (Above plus INSERT, DELETE, UPDATE)
{LETTER}{GROUP ID}admin Read/write (Above plus administrative capabilities)
Continuing our example, the "leaf" project's three users are: l13751ro, l13751rw, and l13751admin.
Passwords are set individually for these accounts from the project database administration page. Before an account can be used, an initial password must be set by the project administrator.
To activate MySQL service for your project, a password must be configured for one or more of the database users issued to your project. Your MySQL-dependent applications should be made to use the read-only or read/write MySQL user as appropriate for the application. The admin user should be used by a human user (as opposed to your application) to manage the database, but should not be used by an application due to security risks.
The admin user is needed to create databases. To create a database, you may do one of:
Connect to phpMyAdmin as your project's database admin user and use the web interface to create a database.
From the interactive shell server, use the command-line MySQL client ('mysql') to connect to the MySQL server as your project's database admin user and issue a CREATE DATABASE.
SourceForge.net performs routine backups for all of our servers and will restore from these backups in the event of catastrophic server failure. We encourage projects to make their own backups of their MySQL data as that data restore can be performed by the project in the event of accidental data destruction by a member of the project team or exploit of their database via project web.
Backups may be performed using our shell service, or phpMyAdmin. See [MySQL Backups] for instructions.
Documentation: MySQL Backups
Documentation: Project Web Services
Documentation: Project Web and Developer Web
Documentation: Shell Service