Old Wiki:Build Database

From EVEmu Wiki
Revision as of 16:15, 3 April 2021 by Admin (talk | contribs) (Bot: Automated import of articles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Contents

Database Installation Guide

NOTE: This guide assumes directory structure created in guide. WARNING: Please note that this guide may be outdated. You can always find the most recent version in sql/README.

Required Software

* MySQL Server 5.1 (I would recommend downloading the Windows Essentials installer, as it is all that is needed)
 * You could also install XAMPP for whatever OS you're using.  This is a complete webserver with apache, PHP, mysql, and other stuff.
* apo15 Official DB dump

Database Setup

Download and install the latest stable version of MySQL 5.1 from the link above.

Extract the dowloaded database dump to directory C:\evemu\source\sql. Browse into C:\evemu\source\sql\utils.

__If you are on Windows:__::
    In the /sql/utils/ directory, Execute merge-evemu-updates.bat and merge-ofic-updates.bat.
__If you are on Linux:__::
    In the /sql/utils/ directory, Execute merge-evemu-updates.sh and merge-ofic-updates.sh.

This should create new files called evemu-updates.sql and ofic-updates.sql in parent directory sql.

Now, you'll have these .sql files in the /sql directory:

* apo15-mysql5-v1.sql  (**This is the biggest sql and takes the longest to write into the database, over 200 MB import**)
* evemu_dynamic-dump.sql
* evemu_static-dump.sql
* evemu-updates.sql
* ofic-updates.sql
* prime_db.sql



Data Import

IMPORTANT: Paths should use / instead of \

Click Start -> All Programs -> MySQL -> MySQL Server 5.1 then MySQL Command Line Client. The MySQL Command Line Client will open, you will need to enter your MySQL database root password.

You will now need to create the EVEmu database, to do this type:

  • create database evemu;

Now hit enter, it should tell you that was successful by saying:

  • Query OK, 1 row affected.


After each query is completed it will display mysql> - at this point simply run the next one.

Now to import the actual data... to do this you'll need to use the following queries (each line is a separate query - don't execute them all at once!):

  • use evemu;
  • source C:/evemu/source/sql/apo15-mysql5-v1.sql;
  • source C:/evemu/source/sql/ofic-updates.sql;
  • source C:/evemu/source/sql/evemu_static-dump.sql;
  • source C:/evemu/source/sql/evemu_dynamic-dump.sql;
  • source C:/evemu/source/sql/evemu-updates.sql;
  • source C:/evemu/source/sql/prime_db.sql;


You can put the entire contents of the above SQL code section in its own .sql file and run that on your database.

Congratulations, you now have the database setup! Now you just need to add a user account.

Adding an Account

This is really simple... just type the following:



  • INSERT INTO account (accountID, accountName, role, password, online) VALUES(NULL, 'your_account_name', 4294967231, PASSWORD('your_password'), 0);


Simply make sure to replace your_account_name and your_password with what you want your username and password to be!

Using the Experimental Branch

     YOU DO NOT HAVE TO DO THIS IF YOU USE REV 1042 OR HIGHER!!!! 

The experimental branch currently has the ability to ban accounts, and therefore requires the following extra sql code be executed:



  • ALTER TABLE `account` ADD COLUMN `banned` TINYINT(1) DEFAULT '0' AFTER `online`;


The experimental branch can make use of bookmarks, and therefore requires the following extra sql code be executed:



  • ALTER TABLE bookmarks MODIFY created BIGINT;