AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Tech Support (https://forums.alliedmods.net/forumdisplay.php?f=36)
-   -   Vault to MySQL Saving Via Windows Steps. (https://forums.alliedmods.net/showthread.php?t=35432)

yang 01-06-2006 20:52

Vault to MySQL Saving Via Windows Steps.
 
Steps to switch vault xp saving to SQL saving in windows!!

MySQL is a database program. So if you wish to use it, download at http://dev.mysql.com/downloads/mysql/5.0.html#downloads and install it.

The following steps are to install mySQL on your local server WINDOWS ONLY, but it can also applied to command steps if you know how to command connect to mySQL via remote linux etc:


1, Download the contribution package:

2, Extract it, and you will need this file from the package:
  • shero_mysql_install.sql

3, Name it a easier name if you want, say shero.sql

4, Open it with a text editor program.
  • Notice this part of the code:

    CREATE DATABASE IF NOT EXISTS SHeroDB;
    USE SHeroDB;
    GRANT SELECT ON `SHeroDB`.* TO SuperHeroModUser@localhost;

    Here "SHeroDB" is the database name.
    The user is SuperHeroModUser Restricted to: localhost

    I prefer to have a password on it. So I switched it to:

    GRANT SELECT ON `SHeroDB`.* TO SuperHeroModUser@localhost IDENTIFIED BY 'password';

    Close & Save.

5, Put it into C: drive.

6, Open DOS Command ( Start -> Run -> type "cmd" )

7, Go into your mysql/bin folder

8, Type "mysql -uroot -ppassword < C:\shero.sql"
  • This will automatically create a superhero database for you.

9, Go into your dedicated server folder then -> /addons/amxmodx/configs/modules.ini
  • Find:

    ; -------------------------------------------
    ; Database Access - only enable one of these
    ; -------------------------------------------
    ; MySQL
    ;mysql_amxx_i386.so
    ;mysql_amxx.dll
    ;mysql_amxx_amd64.so

    Change it to:

    ; -------------------------------------------
    ; Database Access - only enable one of these
    ; -------------------------------------------
    ; MySQL
    mysql_amxx_i386.so
    mysql_amxx.dll
    mysql_amxx_amd64.so

    Now you have mysql module enabled.
10, Open /addons/amxmodx/configs/plugins.ini
  • Change:

    //To save XP to the VAULT file (default)
    superheromodvault.amxx

    To:
    //To save XP to the VAULT file (default)
    //superheromodvault.amxx
    superheromodmysql.amxx

    This will enable the interaction between superhero mod and mysql module.

11, Open /addons/amxmodx/configs/shero/shconfig.cfg and edit accordingly:
  • Find:

    // *** MySQL Settings, Only Needed if using the mysql saving method ***
    // Uncomment the cvar lines to enable these settings

    sh_mysql_host "localhost" << if locally saved, leave it be.
    sh_mysql_user "SuperHeroModUser" << We already set this in step 4
    sh_mysql_pass "" << If we added password in step 4, type it here, otherwise leave it blank.
    sh_mysql_db "sherodb" << The database name we created in step 4.
    sh_mysql_persistent 0

12, Close and ReOpen Server.

13, Join server, open console. Type: amx_shvaulttosql << TYPE IT ONLY ONCE!! Don't know why
but if vittu and jtp says so it gotta be right. So there ya go. You have now successfully installed mySQL xp saving.

123 01-07-2006 09:45

Re: Vault to MySQL Saving Via Windows Steps.
 
Quote:

Originally Posted by yang
6, Open DOS Command ( Start -> Run -> type "cmd" )

7, Go into your mysql/bin folder

8, Type "mysql -uroot -ppassword < C:\shero.sql"
  • This will automatically create a superhero database for you.

It is way easier to add it via phpMyAdmin
Simply select the sql file under the menu SQL.

And your guide can only be used if the mysql database is located on the same pc as the server.
And actually the server creates the databases that is needed, if the connection is right.

yang 01-07-2006 13:40

actually... if i'm not mistaken, you can simply telnet to remote server and type the almost exact command to run it on a remote unix server if i'm not mistaken o.O.... so Imma gonna have to argue that you can use this guide even for unix setup. Except for C:\shero.sql it would probably be somethign like /home/user/username/shero.sql assuming you put the shero.sql in the username folder. Also btw, I don't like phpAdmin, I have it installed. I tried both but I find myself going to the command more often than not since not every server use phpmyadmin so I think commands are more versatile. :P

123 01-07-2006 13:41

If you only have a webhotel on a remote computer, you do not have root access...
Then it can't be used.

yang 01-07-2006 13:43

i'm pretty sure when a webhost gives u a mySQL server they give a user access on their mySQL DB no?

123 01-07-2006 13:46

Mostly you only get access via phpMyAdmin.
You have only one database, and you are not allowed to create any more.

yang 01-07-2006 13:49

so then I would just use that database for shero saving no? Just remove the create database part from the shero db install script. Just start from:

USE SHERODB; << or whatever the database name is o.O... cannot be done?

DFG 03-03-2006 05:46

cant make anything whit dos
doesnt work i says cnat find the file specified

RealAdmin 03-18-2006 16:45

hi.

i have a quick Q if i may, the last command, does that take the xp out of the vault and put it into the DB ?

i wish to move from vault to mysql, but dont know how to import the xp across, am i right in assuming this will take care of that for me?

thankyou

123 03-18-2006 20:37

Quote:

Originally Posted by SuperHero Mod Commands
amx_shvaulttosql - Command to copy vault into mysql. Run it once to convert to the XP in the vault to mysql database. Run it ONLY ONCE. This command is only available if you are using the plugin compiled for mysql saving. Table Schema is in superheromodmysql.inc, you must build the tables first. If you're smart enough to run mysql I'm sure you're smart enough make the tables.



All times are GMT -4. The time now is 23:58.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.