MySQL for AMX Mod X simple Mini-HOWTO

General discussion about Warcraft MODs for CS/CZ/DOD

Moderator: Forum Moderator

Locked
User avatar
Lazarus Long
Lead PITA SOB
Posts: 618
Joined: Tue Jul 05, 2005 9:24 pm

MySQL for AMX Mod X simple Mini-HOWTO

Post by Lazarus Long » Sat Aug 27, 2005 2:56 am

[anchor]a0[/anchor]Index:
  1. I - [goto=a1]Prerequisites[/goto]

    II - [goto=a2]MySQL[/goto]
    1. [goto=a2d1]Server and utilities installation[/goto]
      1. [goto=a2d1d1]Microsoft Windows[/goto]
      2. [goto=a2d1d2]GNU Linux[/goto]
    2. [goto=a2d2]Configuration for AMX Mod X[/goto]
    III - [goto=a3]AMX Mod X[/goto]
    1. [goto=a3d1]Stopping the server[/goto]
    2. [goto=a3d2]Configuring AMX Mod X[/goto]
    IV - [goto=a4]Converting to MySQL and creating admins[/goto]
    1. [goto=a4d1]Skipping (for fresh server installation)[/goto]
    2. [goto=a4d2]Preparing the database[/goto]
    3. [goto=a4d3]Converting AMX Mod X admins[/goto]
      1. [goto=a4d3d1]Converting from Files[/goto]
      2. [goto=a4d3d2]Converting from SQLite[/goto]
    4. [goto=a4d4]Creating AMX Mod X admins[/goto]
    V - [goto=a5]Wrap[/goto]
    1. [goto=a5d1]Starting the server[/goto]
[anchor]a1[/anchor]I - Prerequisites:
  1. [anchor]a1d1[/anchor]You are running the server (dedicated or listen) under Microsoft Windows or GNU Linux (The author has no experience with the *BSD flavors, although the Linux instructions might apply).
  2. [anchor]a1d2[/anchor]You have a working AMX Mod X enabled server.
    1. [anchor]a1d2da[/anchor]If you don't have a working AMX Mod X enabled server you may want to read the Installation and Configuration chapters of the AMX Mod X Documentation.
  3. [anchor]a1d3[/anchor]You are installing the MySQL v4.1 branch (the recommended one at the time of this writing).
    1. [anchor]a1d3da[/anchor]You may want to have a look at the MySQL site for other versions of MySQL.
[anchor]a2[/anchor]II - MySQL:
  1. [anchor]a2d1[/anchor]Install the MySQL server and utilities:
    1. [anchor]a2d1d1[/anchor]Microsoft Windows:
      1. [anchor]a2d1d1d1[/anchor]If you have a previous broken MySQL server installed or if you got stuck with a stalled installation (WARNING: If you have a working MySQL server do not follow these procedures, they will destroy your databases, instead backup your databases, uninstall the MySQL server, follow the [goto=a2d1d1d2]fresh installation steps[/goto] and restore your saved databases):
        1. [anchor]a2d1d1d1d1[/anchor]Go to Start -> Control Panel -> Administrative Tools -> Services and take note of the name of all your MySQL service instances (normally it will be only one called MySQL but if you have more take note of them);
        2. [anchor]a2d1d1d1d2[/anchor]Issue the following in a Command Prompt (if you found more than one service in the above step repeat the command with all the MySQL services in your system)

          Code: Select all

          net stop <mysql service>
        3. [anchor]a2d1d1d1d3[/anchor]Issue the following in the same Command Prompt

          Code: Select all

          mysqld-nt -remove
          mysqld-nt --bind-address=127.0.0.1 --port=3306 --skip-grant-tables
        4. [anchor]a2d1d1d1d4[/anchor]On another Command Prompt issue the following command

          Code: Select all

          mysql -u root
        5. [anchor]a2d1d1d1d5[/anchor]On the MySQL interactive shell issue the following commands

          Code: Select all

          USE mysql;
          UPDATE user SET password=PASSWORD('') WHERE user='root' AND host='localhost';
          quit
        6. [anchor]a2d1d1d1d6[/anchor]Switch over to the other Command Prompt where mysqld-nt is running and Close the window;
        7. [anchor]a2d1d1d1d7[/anchor]On the remaining Command Prompt issue the following

          Code: Select all

          mysqladmin -u root shutdown
        8. [anchor]a2d1d1d1d8[/anchor]Go to Start -> MySQL -> MySQL Server Instance Config Wizard and delete your current configured instance;
        9. [anchor]a2d1d1d1d9[/anchor]Go to Start -> Control Panel -> Add/Remove Programs and uninstall all the MySQL servers you might have;
        10. [anchor]a2d1d1d1d10[/anchor]Open the Windows Explorer, browse to the folder where you had the MySQL server installed (normally at "C:\Program Files\MySQL" but you might have changed it) and delete the whole folder (if you followed the above steps correctly it will only contain configuration backups and the database storage files), if your system refuses to remove the MySQL folder itself alleging it is in use or not empty, reboot, remove the folder and continue;
        11. [anchor]a2d1d1d1d11[/anchor]Continue to the fresh install section.
      2. [anchor]a2d1d1d2[/anchor]If you are doing a fresh install (or after [goto=a2d1d1d1]doing the above procedures[/goto]):
        1. [anchor]a2d1d1d2d1[/anchor]Download the Windows (x86) Installer or the minimalistic Windows Essentials (x86) Installer (if your single intended usage of MySQL is to serve as AMX Mod X backend go for the Essentials Installer);
          1. [anchor]a2d1d1d2d1da[/anchor]
          2. If the above links fail there might be a newer release so, you may want to have a look at the MySQL site for other versions of MySQL;
          3. [anchor]a2d1d1d2d1db[/anchor]The different packages for Microsoft Windows are explained in the MySQL article "The all-new MySQL Server Windows Installer".
        2. [anchor]a2d1d1d2d2[/anchor]After downloading the installer double click on the mysql-essential-4.1.X-win32.msi to start the installation (I'm assuming you are installing the Windows Essentials package, if you have downloaded the larger Windows package you must extract the installer from the zip file);
        3. [anchor]a2d1d1d2d3[/anchor]Select Typical as the type of installation, since you won't be needing neither the C header files neither the development libraries (you won't be developing for MySQL, right?);
        4. [anchor]a2d1d1d2d4[/anchor]Wait until all the files are installed on your system and proceed to configure the server;
        5. [anchor]a2d1d1d2d5[/anchor]Select Detailed Configuration and press the Next button;
        6. [anchor]a2d1d1d2d6[/anchor]Now you have the choice of setting the type of server you want, for a listen server select Developer Machine, for a dedicated server and if you will not be using this machine for anything but serving the game you may select Server Machine, else select Developer Machine and press the Next button;
        7. [anchor]a2d1d1d2d7[/anchor]It is time to select the type of container your databases will use by default, so just select Non-transactional Database Only and press the Next button;
        8. [anchor]a2d1d1d2d8[/anchor]Then you can select the number of simultaneous connections to your MySQL server, so select Manual Setting, go for the default 15 on the concurrent connections drop down box and press the Next button;
        9. [anchor]a2d1d1d2d9[/anchor]Now you will set the network connections (here is the first pitfall of the installer), although you are installing the MySQL server in the same machine as the game server, and in spite of the risk of exposing your server to tampering if you are allowing Internet access to it, the Microsoft Windows installer for MySQL is buggy in this step (My Opinion TM) and since, unfortunately, named pipes support under Microsoft Windows are even more buggier (once again My Opinion TM) you are going to enable TCP/IP during the installation process (don't worry it will be fixed in a few steps) so select the Enable TCP/IP Networking, keep the standard 3306 for the Port Number and press the Next button;
        10. [anchor]a2d1d1d2d10[/anchor]It is time to set the way the server understands localization such as time and special characters, since neither Counter-Strike, nor Counter-Strike: Condition Zero nor Day of Defeat support anything but the ASCII character set, there is no point in selecting anything but the default Standard Character Set (and it even saves you some unneeded waste of time due to conversion at the database engine level), so go for it and press the Next button;
        11. [anchor]a2d1d1d2d11[/anchor]You will now configure how the system starts and finds the MySQL server, so select both Install As Windows Service, keeping the MySQL as the Service Name and selecting Launch the MySQL Server automatically, and Include Bin Directory in Windows PATH and press the Next button;
        12. [anchor]a2d1d1d2d12[/anchor]Finally set up the security for root (here is the second pitfall of the installer), although setting a password for root is almost mandatory for security reasons if you made even a small mistake and had a password set here the whole configuration process would fail on the next step so for ease of finishing the Configuration Wizard you will not be setting a password for root now (don't worry you will set one in a few steps), so select Modify Security Settings, leave the password fields blank, select the Root may only connect from localhost check box, and press the Next button;
        13. [anchor]a2d1d1d2d13[/anchor]Now on the final screen of the Configuration Wizard press the Execute button, cross you fingers and you are (almost) done;
        14. [anchor]a2d1d1d2d14[/anchor]Now lets fix up the above pitfalls, go to Start -> Control Panel -> Administrative Tools -> Services, locate the MySQL service and stop it;
        15. [anchor]a2d1d1d2d15[/anchor]Open a Command Prompt and issue the following commands (replace <MySQL basedir> with the path where you installed the MySQL server - usually "%ProgramFiles%\MySQL\MySQL Server 4.1", with %ProgramFiles% being your Program Files base folder)

          Code: Select all

          cd <MySQL basedir>
          notepad my.ini
        16. [anchor]a2d1d1d2d16[/anchor]Search for the client section and make sure that you have a port=3306 entry there (the following is a snippet of the client section of my.ini)

          Code: Select all

          # CLIENT SECTION
          # ----------------------------------------------------------------------
          #
          # The following options will be read by MySQL client applications.
          
          # Note that only client applications shipped by MySQL are guaranteed
          # to read this section. If you want your own MySQL client program to
          # honor these values, you need to specify it as an option during the
          # MySQL client library initialization.
          #
          [client]
          
          port=3306
        17. [anchor]a2d1d1d2d17[/anchor]Search for the server section and make sure that you have a port=3306 entry and add a bind-address=127.0.0.1 entry there (the following is a snippet of the server section of my.ini)

          Code: Select all

          # SERVER SECTION
          # ----------------------------------------------------------------------
          #
          # The following options will be read by the MySQL Server. Make sure that
          # you have installed the server correctly (see above) so it reads this 
          # file.
          #
          [mysqld]
          
          # The TCP/IP Port the MySQL Server will listen on
          port=3306
          bind-address=127.0.0.1
        18. [anchor]a2d1d1d2d18[/anchor]On the same server section make sure that the paths in both basedir and datadir reflect your system;
        19. [anchor]a2d1d1d2d19[/anchor]Go back to Start -> Control Panel -> Administrative Tools -> Services, locate the MySQL service and start it (first pitfall fixed);
        20. [anchor]a2d1d1d2d20[/anchor]Open a Command Prompt and issue the following command (second pitfall fixed)

          Code: Select all

          mysqladmin -u root password <desired root password>
    2. [anchor]a2d1d2[/anchor]GNU Linux:
      1. [anchor]a2d1d2d1[/anchor]In short stick with the pre-packaged MySQL package your distribution may have;
      2. [anchor]a2d1d2d2[/anchor]The MySQL server is a very complicated software piece and the maintainers of the package for your distribution know much better than you how to set it up to work with the rest of the system. That said and if you know what you are doing there are several binary packages at the MySQL 4.1 Downloads page as well as a source tarball if you know what to do with it. By the way if you are even considering any of the above possibilities beside sticking with your distribution package then why are you reading this? You know what has to be done, go on and set up the damn thing. Don't wast your time here... Go, go, go...;
      3. [anchor]a2d1d2d3[/anchor]OK, now that he is on his way let me say this one more time, to install the MySQL server use your distribution package system.
      4. [anchor]a2d1d2d4[/anchor]There is a large number of GNU Linux distributions out there each one setting things slightly different from the others and the author is not familiar with all of them, so the questions that your distribution installer may pose you might vary. Never less the common questions are asking you for:
        1. [anchor]a2d1d2d4d1[/anchor]The superuser (usually root) password;
        2. [anchor]a2d1d2d4d2[/anchor]TCP/IP (remote) access;
        3. [anchor]a2d1d2d4d3[/anchor]Whether to start the server at boot.
      5. [anchor]a2d1d2d5[/anchor]If you get any question about choosing between MyISAM or InnoDB stick with the Non-transactional MyISAM;
      6. [anchor]a2d1d2d6[/anchor]For other questions take a look at the [goto=a2d1d1d2]above options for Microsoft Windows[/goto] and chose accordingly;
      7. [anchor]a2d1d2d7[/anchor]You should read the documentation that accompanies your server, normally at /usr/share/doc/mysql, /usr/share/doc/mysql-server, or /usr/share/doc/<mysql server package name> depending on your distribution;
      8. [anchor]a2d1d2d8[/anchor]Also the configuration file(s) for the MySQL server are usually located at /etc/mysql so have a look there (look for my.cnf, it's the main configuration file).
  2. [anchor]a2d2[/anchor]Configuring the MySQL server for AMX Mod X access:
    1. [anchor]a2d2d1[/anchor]Create the database for AMX Mod X by issuing the following command either in a Command Prompt for Microsoft Windows or in a shell for GNU Linux (note that there is no space between -p and the password)

      Code: Select all

      mysqladmin -u root -p<root password> create amxx
      1. [anchor]a2d2d1da[/anchor]For convention this Mini-HOWTO will be using "amxx" for the database name and user, you are free to change these to suite your preferences.
    2. [anchor]a2d2d2[/anchor]Enter the interactive MySQL shell by issuing the following command either in a Command Prompt for Microsoft Windows or in a shell for GNU Linux (note that there is no space between -p and the password)

      Code: Select all

      mysql -u root -p<root password>
    3. [anchor]a2d2d3[/anchor]Create the user to be used by AMX Mod X by issuing the following command in the MySQL interactive shell

      Code: Select all

      GRANT USAGE ON * . * TO 'amxx'@'localhost' IDENTIFIED BY '<amxx user password>' ;
    4. [anchor]a2d2d4[/anchor]Configure the AMX Mod X user amxx to have access to the AMX Mod X database amxx by issuing the following command in the MySQL interactive shell

      Code: Select all

      GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , INDEX , ALTER , CREATE TEMPORARY TABLES , LOCK TABLES ON `amxx` . * TO 'amxx'@'localhost' ;
    5. [anchor]a2d2d5[/anchor]Exit the MySQL interactive shell by issuing the following command

      Code: Select all

      quit
    6. [anchor]a2d2d6[/anchor]Login as the new user amxx you have just created to confirm that everything is correct by issuing the following command either in a Command Prompt for Microsoft Windows or in a shell for GNU Linux (note that there is no space between -p and the password)

      Code: Select all

      mysql -u amxx -p<amxx user password> amxx
    7. [anchor]a2d2d7[/anchor]Exit the MySQL interactive shell by, once again, issuing the following command

      Code: Select all

      quit
[anchor]a3[/anchor]III - AMX Mod X:
  1. [anchor]a3d1[/anchor]Start by stopping your game server in the usual way for your system. If you are running a listen server simply quit the game, if you are running a dedicated server you may have several ways to stop it, if everything else fails issue the command

    Code: Select all

    quit
    in the game console.
  2. [anchor]a3d2[/anchor]You now have to configure AMX Mod X to access the MySQL database:
    1. [anchor]a3d2d1[/anchor]The AMX Mod X configuration files are text files and you will be editing them with your system text editor, either Notepad for Microsoft Windows, or vi for GNU Linux (your default editor might not be vi, so use the one you are used to, I'll be using vi for the remaining of this Mini-HOWTO, so replace where appropriate).
    2. [anchor]a3d2d2[/anchor]Locate your base directory for the game (don't ask me where it is, you installed the thing) and change to the AMX Mod X configuration folder.
      1. [anchor]a3d2d2d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows (replace <steam account> with your Steam login name and <game mod folder> with the game you are running)

        Code: Select all

        cd "SteamApps\<steam account>\<game mod folder>\addons\amxmodx\configs"
      2. [anchor]a3d2d2d2[/anchor]Issue the following command in a shell for GNU Linux (replace <game mod> with the game you are running)

        Code: Select all

        cd <game mod>/addons/amxmodx/configs
    3. [anchor]a3d2d3[/anchor]Edit the sql.cfg configuration file.
      1. [anchor]a3d2d3d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows

        Code: Select all

        notepad sql.cfg
      2. [anchor]a3d2d3d2[/anchor]Issue the following command in a shell for GNU Linux

        Code: Select all

        vi sql.cfg
    4. [anchor]a3d2d4[/anchor]Change the variables amx_sql_host, amx_sql_user, amx_sql_pass, amx_sql_db and amx_sql_table in the file to read as follows

      Code: Select all

      // SQL configuration file
      // File location: $moddir/addons/amxmodx/configs/sql.cfg
      
      
      // *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
      // We recommend using your server IP address instead of its name
      
      amx_sql_host	"127.0.0.1"
      [color=green]amx_sql_user	"amxx"
      amx_sql_pass	"<amxx user password>"
      amx_sql_db	"amxx"[/color]
      amx_sql_table	"admins"
    5. [anchor]a3d2d5[/anchor]Edit the modules.ini file.
      1. [anchor]a3d2d5d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows

        Code: Select all

        notepad modules.ini
      2. [anchor]a3d2d5d2[/anchor]Issue the following command in a shell for GNU Linux

        Code: Select all

        vi modules.ini
    6. [anchor]a3d2d6[/anchor]Uncomment the MySQL modules (make absolutely sure you leave the other database modules commented), the database section must look like

      Code: Select all

      ; -------------------------------------------
      ; Database Access - only enable one of these
      ; -------------------------------------------
      ; MySQL
      [color=green]mysql_amxx_i386.so
      mysql_amxx.dll
      mysql_amxx_amd64.so[/color]
      ; PostgreSQL
      ;pgsql_amxx_i386.so
      ;pgsql_amxx.dll
      ; Microsoft SQL
      ;mssql_amxx.dll
      ; SQLite
      ;sqlite_amxx.dll
      ;sqlite_amxx_i386.so
      ;sqlite_amxx_amd64.so
    7. [anchor]a3d2d7[/anchor]Edit the plugins.ini file.
      1. [anchor]a3d2d7d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows

        Code: Select all

        notepad plugins.ini
      2. [anchor]a3d2d7d2[/anchor]Issue the following command in a shell for GNU Linux

        Code: Select all

        vi plugins.ini
    8. [anchor]a3d2d8[/anchor]Uncomment the SQL Admin Base plugin and make sure to comment the non-SQL one, the admin base section must look like

      Code: Select all

      ; AMX Mod X plugins
      
      ; Admin Base - Always one has to be activated
      ;admin.amxx		; admin base (required for any admin-related)
      [color=green]admin_sql.amxx[/color]		; admin base - SQL version (comment admin.amxx)
[anchor]a4[/anchor]IV - Converting to MySQL and creating admins:
  1. [anchor]a4d1[/anchor]If you don't have any AMX Mod X admins you would like to insert or convert to or MySQL database format you can [goto=a5]wrap it up[/goto].
  2. [anchor]a4d2[/anchor]Preparing the database:
    1. [anchor]a4d2d1[/anchor]Login as the user amxx you have created before by issuing the following command either in a Command Prompt for Microsoft Windows or in a shell for GNU Linux (note that there is no space between -p and the password)

      Code: Select all

      mysql -u amxx -p<amxx user password> amxx
    2. [anchor]a4d2d2[/anchor]Create the AMX Mod X admins table by issuing the following command in the MySQL interactive shell

      Code: Select all

      CREATE TABLE `admins` (`auth` VARCHAR(32) NOT NULL DEFAULT '', `password` VARCHAR(32) NOT NULL DEFAULT '', `access` VARCHAR(32) NOT NULL DEFAULT '', `flags` VARCHAR(32) NOT NULL DEFAULT '') COMMENT = 'AMX Mod X Admins' ;
  3. [anchor]a4d3[/anchor]Converting AMX Mod X admins:
    1. [anchor]a4d3d1[/anchor]Converting from Files:
      1. [anchor]a4d3d1d1[/anchor]Populate the AMX Mod X admins table with your admins (you can find the values to enter in the following SQL statement in the users.ini file in your AMX Mod X configuration directory):
        1. [anchor]a4d3d1d1d1[/anchor]If your server is running on Microsoft Windows you are out of luck, you will have to do this by hand so issue the following command in the MySQL interactive shell (the admin ID can be any one of IP, STEAM ID or player name, if you are only inserting one admin replace the ',' from the first data row with ';')

          Code: Select all

          REPLACE INTO `admins` (`auth`, `password`, `access`, `flags`) VALUES
          ('<first admin ID>', '<first admin password>', '<first admin access levels>', '<first admin flags>'),
          ('<second admin ID>', '<second admin password>', '<second admin access levels>', '<second admin flags>'),
          ...
          ('<last admin ID>', '<last admin password>', '<last admin access levels>', '<last admin flags>');
        2. [anchor]a4d3d1d1d2[/anchor]If your server is running on GNU Linux you can either do as above for Microsoft Windows (recommended if you have 1 or 2 admins) or you may exit the MySQL interactive shell (as indicated in the [goto=a4d3d1d2]next point[/goto]) and issue the following command in a shell (note that there is no space between -p and the password)

          Code: Select all

          awk -F \" '{ if (/;|#|^ *$|\/\//) next ; if (NF != 9) next ; printf "REPLACE INTO `admins` (`auth`, `password`, `access`, `flags`) VALUES ( \"%s\", \x27%s\x27, \x27%s\x27, \x27%s\x27 );\n", $(NF-7), $(NF-5), $(NF-3), $(NF-1) }' <users.ini |mysql -u amx -p<amx user password> amx
      2. [anchor]a4d3d1d2[/anchor]Exit the MySQL interactive shell by, once again, issuing the following command

        Code: Select all

        quit
    2. [anchor]a4d3d2[/anchor]Converting from SQLite:
      1. [anchor]a4d3d2d1[/anchor]If you had your game server previously configured to read your admins from a SQLite database you can convert it to MySQL:
        1. [anchor]a4d3d2d1d1[/anchor]Exit the MySQL interactive shell by issuing the following command

          Code: Select all

          quit
        2. [anchor]a4d3d2d1d2[/anchor]For Microsoft Windows:
          1. [anchor]a4d3d2d1d2d1[/anchor]Issue the following commands in a Command Prompt (replace <SQLite complete database path> with the full path, including filename and extension, of the SQLite database you are converting from, note the dot at the beginning of ".dump" and ".quit" and that you won't see a prompt when you enter ".quit", just do it anyway)

            Code: Select all

            echo .dump admins >sqlite.cfg
            sqlite3 -init sqlite.cfg "<SQLite complete database path>" >amxx.sql
            .quit
            del sqlite.cfg
            notepad amxx.sql
          2. [anchor]a4d3d2d1d2d2[/anchor]Edit the amxx.sql file and remove the two first and the last lines from it, the only lines that should remain are those that start with "INSERT". Exit Notepad saving the file.
          3. [anchor]a4d3d2d1d2d3[/anchor]Issue the following commands in a Command Prompt (note that there is no space between -p and the password)

            Code: Select all

            mysql -u amxx -p<amxx password> amxx <amxx.sql
            del amxx.sql
        3. [anchor]a4d3d2d1d3[/anchor]For GNU Linux:
          1. [anchor]a4d3d2d1d3d1[/anchor]Issue the following commands in a shell (replace <SQLite complete database path> with the full path, including filename and extension, of the SQLite database you are converting from, note the dot at the beginning of ".dump" and ".quit" and that you won't see a prompt when you enter ".quit", just do it anyway)

            Code: Select all

            echo .dump admins >sqlite.cfg
            sqlite3 -init sqlite.cfg "<SQLite complete database path>" >amxx.sql
            .quit
            rm sqlite.cfg
            vi amxx.sql
          2. [anchor]a4d3d2d1d3d2[/anchor]Edit the amxx.sql file and remove the two first and the last lines from it, the only lines that should remain are those that start with "INSERT". Exit vi saving the file.
          3. [anchor]a4d3d2d1d3d3[/anchor]Issue the following commands in a shell (note that there is no space between -p and the password)

            Code: Select all

            mysql -u amxx -p<amxx password> amxx <amxx.sql
            rm amxx.sql
  4. [anchor]a4d4[/anchor]Creating AMX Mod X admins:
    1. [anchor]a4d4d1[/anchor]Enter the MySQL interactive shell by issuing the following command either in a Command Prompt for Microsoft Windows or in a shell for GNU Linux (note that there is no space between -p and the password)

      Code: Select all

      mysql -u amxx -p<amxx user password> amxx
    2. [anchor]a4d4d2[/anchor]Issue the following command in the MySQL interactive shell (the admin ID can be any one of IP, STEAM ID or player name, the possible values to use on the rest of the fields are explained in the Configuration: Admins chapter of the AMX Mod X Documentation, you can repeat this command with different values until you are out of admins)

      Code: Select all

      REPLACE INTO `admins` (`auth`, `password`, `access`, `flags`) VALUES ('<admin ID>', '<admin password>', '<admin access levels>', '<admin flags>');
    3. [anchor]a4d4d3[/anchor]One admin entry, which gives full admin rights to the game console itself, you most likely should be entering is

      Code: Select all

      REPLACE INTO `admins` (`auth`, `password`, `access`, `flags`) VALUES ('loopback','','abcdefghijklmnopqrstu','de');
[anchor]a5[/anchor]V - Wrap:
  1. [anchor]a5d1[/anchor]You are done, it's now time to start your game server in the usual way for your system.
OK, I hope I didn't make any big mistake, or forget something important, if so, feel free to correct me, and I'll try to update this Mini-HOWTO. Thanks for reading this far.


Edits:
  • 2005-08-27 - split from the original Mini-HOWTO to keep AMX Mod X generic setup separated from the MODs specific
  • 2005-08-27 - added information about converting from SQLite
  • 2005-08-28 - fixed a bunch of small typos
  • 2005-09-03 - changed the awk script to allow the ' character in names, by sugestion of anders_dog
Lazarus

Locked