How to Install OxMySQL on Your FXServer

A step-by-step guide to setting up OxMySQL, a high-performance database wrapper for your FiveM server.


What is OxMySQL?

OxMySQL is an optimized database wrapper for FXServer that offers improved performance and compatibility compared to alternatives like GhmattiMySQL or MySQL Async. Key features include:

  • Enhanced compatibility with MySQL 8.0.
  • Reduced overhead by immediately returning callbacks.
  • Faster performance for database interactions.

Step 1: Download OxMySQL

  1. Visit the OxMySQL GitHub page.
  2. Download the .ZIP file for the most stable build, as shown on the page. Avoid experimental or beta builds unless you’re comfortable troubleshooting potential issues.

Step 2: Upload the OxMySQL Files

  1. Navigate to Your Server’s Resource Directory:

    • Go to your /resources folder in your FXServer directory.
  2. Extract the OxMySQL Files:

    • Extract the contents of the downloaded .ZIP file into a new folder named oxmysql.
  3. Upload via File Manager or FTP:

    • If you’re hosting remotely, upload the extracted files to your server using an FTP client like FileZilla or WinSCP, or use the file manager in your hosting control panel.

Step 3: Add OxMySQL to Your Server Configuration

  1. Locate and Edit server.cfg:

    • Open the server.cfg file located in the root directory of your FXServer.
  2. Add the Following Line to Start OxMySQL:

    start oxmysql
    
  3. Add Your MySQL Connection String:

    • Insert your database connection string below the start oxmysql line:
      set mysql_connection_string "mysql://username:password@localhost/database"
      
    • Replace the placeholders with your actual database credentials:
      • username: Your MySQL username.
      • password: Your MySQL password (avoid = symbols, as OxMySQL does not support them).
      • localhost: Your MySQL server address (or its IP).
      • database: The name of your database.

Step 4: Resetting Your Database Password (If Needed)

If your database password includes unsupported characters like =, you’ll need to regenerate it:

  1. Navigate to your hosting control panel's Databases section.
  2. Select your database and click Reset Password.
  3. Update the new password in your server.cfg connection string.

Step 5: Start Your Server and Verify Installation

  1. Restart your FXServer.
  2. Check the server console for OxMySQL logs:
    • Look for a message indicating a successful database connection.
    • Example:
      [oxmysql] Connected to database successfully.
      

If you see this confirmation, your installation is complete, and OxMySQL is ready for use.


Troubleshooting Tips

  1. Connection Errors:

    • Ensure the MySQL database credentials in your connection string are accurate.
    • Verify that your MySQL server is accessible from your FXServer machine.
  2. Database Password Issues:

    • Avoid special characters like = in your password. Regenerate it if necessary.
  3. Missing Files or Errors:

    • Ensure all OxMySQL files were uploaded correctly. Re-download and re-upload if needed.

Final Thoughts

Installing OxMySQL on your FXServer ensures faster and more reliable database interactions for your FiveM server. By following this guide, you’ll have a fully functional database wrapper up and running in no time.

Need high-performance hosting for your FiveM server? Goodleaf Hosting offers optimized servers with full support for resources like OxMySQL, ensuring seamless gameplay for your community. Start building your server today!

Răspunsul a fost util? 0 utilizatori au considerat informația utilă (0 Voturi)