Results 1 to 1 of 1

Thread: databases.cfg setup

  1. Default databases.cfg setup

    1) To setup sourcemod to connect to a remote database you first need a few things:
    database name: the name that you created for your database
    database user: the user that has access to the database you are using
    user password: the password that the database user uses
    database address: your connecting remotely so do not enter localhost or remotemysqlhost. If you use local host to connect to the database from your website then use the url of your website or the name of the server you are on. The point is that you just need it to go to the ip that your web server is currently on. If you normally use a remotemysqlhost connection the process is a bit different as you need to know the ip of that remote sql server. If you do not know the ip of your sql server just send a support ticket to your host and they will be happy to give you the correct information.
    port: the default is 3306 if your game server host has blocked that port you will be unable to connect to most remote sql servers. This however, is rarely the case. Equally possible though is that your sql host could be using a different port. If you are having trouble connecting confirm with your host that port 3306 is the one used and that it is not being blocked.

    2) Once you have all of this info enter it into databases.cfg in the following format:

    "name of plug in"
    "driver" "default"
    "host" "database address"
    "database" "database name"
    "user" "database user"
    "pass" "user password"
    //"timeout" "0"
    "port" "3306"

    3) Now that you have that entered you may need to configure your sql server to accept the remote connection:

    Before you start you will need the ip of the connecting server. This is not as easy as it sounds! To get the correct ip address you will need to get the server to try to connect to the database using what ever plugin needs it. When that plug in fails to connect to the database it will generate an error log in: addons\sourcemod\logs Find the appropriate log file and open it. Once open you will be able to see what the host that is trying to connect to the sql database is, copy that address

    In your control panel for your web or sql server find the option to add access hosts. You will need to enter the ip of the server that is trying to connect.

    4) Only some users will need to follow this final step. However, preforming this step is still recommended if you want to be 99.9% sure that your install will work first shot:

    Using a program such as phpmyadmin access you database and go to the Query tab. From there you will need to execute the following command:

    GRANT ALL ON DatabaseName.* TO 'UserName'@'AddressUsedInStep3';

    remember to enter it in exactly like that with the quotes and ;

    5) Test it out! Your database should work and it will luckily not be so hard to set it up for your other plugins as most of these steps only need to be done once.

    By: ZERO <ibis>
    Last edited by ZERO; 06-07-2008 at 11:14 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts