MySQL
MySQL is the world’s most popular open source database system.
Using MySQL/MariaDB as an alternative to MSSQL
- Open
src/.env.
- Replace the
OWSDBConnectionString
withserver=host.docker.internal;user=root;database=openworldserver;port=3306;password=yourStrong(!)Password;Allow User Variables=True;SslMode=None
- Replace the value in OWSDBBackend with mysql
Update database version
-
Open MySQL Workbench and connect to localhost using the following credentials:
- Username
- root
- Password
- yourStrong(!)Password
-
Run the following SQL statement against the Open World Server database.
SELECT * FROM OWSVersion
-
Compare the OWSDBVersion returned with the SQL update scripts in the
Databases\MSSQL\UpdateScriptsFolder
to see which scripts to run on your database. -
The update scripts have From[SomeVersion]To[SomeVersion] in the name. Run them in order starting with the From[SomeVersion] that matches your OWSDBVersion from the previous step. To run the script open the file, copy the contents from it and run it as a SQL statement against the Open World Server database like you did in step 2. If you are not familiar with SQL please refer to the SQL Tutorial to learn more about it.
Create API Key
-
Open MySQL Workbench and connect to localhost using the following credentials:
- Username
- root
- Password
- yourStrong(!)Password
-
Run the following SQL statment against the Open World Server database.
(Optional): A specific GUID can be entered as an optional final parameter, after password, in the format of ‘00000000-0000-0000-0000-000000000000’.
CALL AddNewCustomer ('CustomerName', 'FirstName', 'LastName', 'Email', 'Password', NULL);
Be sure to replace the values:
- CustomerName
- The nickname or profile name of the customer.
- FirstName
- The firstname of the customer.
- LastName
- The lastname of the customer.
- Enter the mail address of the customer.
- Password
- Enter a secure password.
-
Run the following SQL statment against the Open World Server database to get your API key. Save the key for later.
SELECT CustomerGUID FROM Customers LIMIT 1;
Additional
If you are using an external MySQL/MariaDB, you need to ensure that the ENCRYPT
function works as is available. Consult your database administrator if unsure.
Secondly you need will need to run the following as a SUPER user, or grant your SUPER access to your user.
SET GLOBAL log_bin_trust_function_creators = 1;