Page 1 of 2

MySQL Database tutorial

Posted: Thu 20 Aug 2009 6:04 am
by II/JG54_Emil
Hello friends,

please can you provide idiot-proof step by step information about how set up a MySQL database on my pc which is also accessible from afar?

This could also work for others as a tutorial(and probably broaden our community).

I already have problem downloading the proper files from sunmicro nor do I know what to do with them as they are no exe or batch files.

Posted: Thu 20 Aug 2009 4:37 pm
by EJGr.Ost_Chamel
I have written a step by step instruction on how to setup a complete SEOW-Server. But there might be several drawbacks for you:
  • The instructions are in GERMAN
  • The server is only intended for personal testing use in a local network, as a server accessible for anyone from the net would require much better safety precautions to prevent bad guys from hacking the server.
So, if you know german - more or less - it might be a starting point for you.

So here is the link:
http://www.taktik-sims.de/forum/viewtop ... 833#p52833

Greetings
Chamel

Posted: Thu 20 Aug 2009 5:44 pm
by II/JG54_Emil
Excellent!!!

If it works for me I will translate it into English for all the other IT-illiterates.

Posted: Sun 23 Aug 2009 4:53 am
by EJGr.Ost_Chamel
Nice! :D

Posted: Mon 24 Aug 2009 2:41 am
by II/JG54_Emil
EJGr.Ost_Chamel on http://www.taktik-sims.de/forum/viewtopic.php?f=154&t=3420&p=52833#p52833 wrote:Step by step instructions for setting up a local SEOW-Server

This guide assumes that all the necessary components are installed on a single Windows computer (XP SP3).

Anyone who has a Linux-machine lying around, can install the Web and the Database server easier on that one (point 1, the local "Web" Server). But who has experience with Linux, will realise the necessary changes to these instructions easily himself.

Estimated time: 1.5 hours (???)
Required Downloads:
The Apache + MySQL server xampp 1.5.1 ( http://downloads.sourceforge.net/source ... irror=kent )
The database SEDB32C ( http://sourceforge.net/projects/seow/fi ... p/download )
SQLyog 8.12 Community Edition ( ttp://www.webyog.com/en/downloads.php )
The Mission Planner ( http://downloads.sourceforge.net/source ... irror=kent )
The "dynamic campaign system" ( http://downloads.sourceforge.net/source ... irror=kent )
the MySQL-Connector 3.51 ( Do Not take the newer version 5.1.5 - it does not work! ( http://mysql.mirrors.webname.dk/Downloa ... -win32.msi )
Maybe still. NET 3.5 ( http://www.microsoft.com/downloads/deta ... 5076bba986 )

1. The local "web" server
Unzip the file xampp-win32-1.7.1.zip into the root directory of any hard disk partition (eg to "C: ") - a "xampp"-subfolder is then created there.
I will proceed in the assumption that the path to this folder is "C: \ xampp" ! If it is on a different drive for you, please adjust the drive letter for each!
In this folder you will find a program called "xampp-control.exe. When you start this program a small program opens with which you can control your newly installed Web server and database. A click on the "Start" button to the right, next to the words "Apache", starts the web server; the MySQL also starts by clicking on the corresponding button.
If you now type in "localhost" in the web browser as the address, you will get to the homepage of your server and after clicking on "English" you are in a user interface for managing the main functions of the server.
After another click on "Security Check" you´ll see a lot of red warning lights, that means the server is unsafe. But do not panic!! Below is the crucial sentence:
"A machine that is not attackable from outside via the Internet or intranet (eg, because a firewall blocks all the major ports to the outside) is SECURE against outside attack." (something comforting liek that)
The most certainly have a router (Fritz! Box or similar to exactly this task) which takes care of blocking of ports ffrom the outside world. As long as you have not set up port forwarding on the important ports (80, 443, 3306, 8080), nothing can really happen.
Yet you click on the link " hhttp://localhost/security/xamppsecurity.php " and come to a page on which you install the 2 most important passwords (MYSQL SEKTION: "ROOT" PASSWORT and Username + Passwort for the XAMPP FOLDER-PROTECTION). Wenn das erledigt ist, liefert ein erneuter Klick auf "Sicherheitscheck schon ein viel freundlicheres Bild. "Next to a page on which you set up the two main Passörter (MYSQL SECTION:" ROOT "PASSWORD and username + password for XAMPP DIRECTORY PROTECTION). When it's done, new-clicking on the "Security Check" delivers a has a much friendlier picture .

Thereby your server is done in software. Theoretically, you can provide websites publicly on the Internet. But this is too dangerous from a security perspective, for XamppLite in its configuration is not laid out for that and therefore unsafe for that purpose. Rather it is designed for use in a closed environment for testing purposes - that is exactly what we're up to it.
But a server is of course worth nothing as long as no content is on it. And so we come to the next point ...

2. The database SEDB
Unpack the SEDB32C.zip file to an empty folder to . This folder contains the necessary database files, you must now put you still on the MySQL server. This could be done with the included XAMPPlite PhpMyAdmin, but I think a different program for the handling / maintenance of the database is much clearer and simpler. So it installed next

3. SQLyog
Start the installation, to which there is really nothing to explain, by double-clicking the file SQLyog812.exe.
If you then start the program SQLyog, you must first create a new connection to a database. Therefore give the connection a name (eg "Local SEOW-server") and the following connection:
MySQL host address: localhost
Username: root
Password: "the predetermined MYSQL ROOT PASSWORD"

Then click "Connect". Respond to the following demand, whether the revised connection information to be saved with "yes" and already you're in the midst of the contents of your database server.
Right-click in the left pane to bring up a context menu where you choose the item "Create Database". Names the database “SEOW1”and leave the other options unchanged.
Thus you have created a new database which must now be filled with the basic data for the SEOW. Therefore right-click "SEOW1" and in the context menu "Import> Restore From SL dump" option. In the opening window click on the button "..." right of the field "File to execute" and thus arrives in a file selection dialog. Now you navigate to the folder where your database files were unzipped earlier (see 2 The database SEDB), and then select the file "SEDB32C_Reference.sql" from. Click on "Execute" and affirm the security prompt to start the process of importing data. If this ends with the message "Import successful", click "Done". Nun braucht der Apache Web-Server die Daten für das Missionsplanungsinterface. Now the Apache Web server needs the data for the Mission Planning interface.

4. The Mission Planner (MP4)
Unzip the zip archive MP4-v4.555.zip into the folder "C:\xampplite\htdocs". There is then the new subfolder "MP4".
You must tell Apache how it can contact to the database. Dazu öffnen wir in einem Texteditor (zB WordPad) die Datei "C:\xampplite\htdocs\MP4\Scripts\MP-Connection.php" und ändern darin die Zeile 13 zu To do that, we open in a text editor (eg WordPad), the file C:\xampplite\htdocs\MP4\Scripts\MP-Connection.php" and change to the line 13 to
$DefaultDBCon = array("mysql","localhost","3306","root","your_MySQL_Root_Password_from_chapter_3.","SEOW1");

and change line 19 to
$SectorDBCon["Berlin"] = &$DefaultDBCon;

In addition, you must change the file "C:\xampplite\htdocs\MP4\Scripts\MP-Configuration.php" on line 14
$IconLocation="/MP4/uniticons/";

After saving the two php files you can see in the browser under the address "http://localhost/MP4/" the known SEOW portal. In it are still no maps / sectors active. That´s why you need now the central program that brings the contents of the server in combination with the game IL-2.

5. The Dynamic Campaign System (SEDCS)
Start with a double click the SEDCS-v3.2.3_installer.exe file. Install the program into any folder and try to start the program. If instead of the DCS seems only an error message appears ( "The application failed to initialize ..."), then .NET Framework is still missing on the computer (point 5a). If the program is running then continue to point 6.

5a. The .NET Framework

Run the dotnetfx35_full_Package.exe file and install it. Then the SEDCS should now work.

6. The MySQL Connector

The DCS is to contact with the database, to translate in the MP planned missions in an IL-2 mission file, and after the mission, read-out the results from the eventlog-file and fill them into the database. In order to access the database still a kind of "driver" is needed.
Die Datei mysql-connector-odbc-3.51.27-win32.msi starten und den MySQL-Connector installieren. Start the mysql-connector-odbc-3.51.27-win32.msi file and install the MySQL Connector.

7. Initialize the first SEOW Campaign
Launch the DCS and activate the tab "Database Settings". Tick “UseMySQL” and enter the following data:
Server Address: localhost
Server Login Name: root
Server Login Password: * the root password The DCS *
Database Name: seow1

After clicking on the button "Make Database Connection" hopefully the message appears:
"Testing MySQL / ADO connection: opening ... reading ... writing ... deleting ... successful closing ..."

Now, you must explain the DCS the position of some important files. To specify enter on the tab "Files/Misc", next to "FB+PF the GAME Log File Location" the path to eventlog.lst in your IL-2 installation. To specify where the DCS is to store the generated mission files, indicate next to "SEOW Mission Folder" a subfolder of the coop-directory in your IL-2 installation.
After that you can now with clicking the tab "Generate/Manage" initialize the first SEOW campaign. In order to do that download on the SEOW-homepage ( http://seow.sourceforge.net/ http://seow.sourceforge.net/ ) a Campaign Template that looks interesting and unpack the file into any folder. Then enter a host name in the DCS (arbitrary) and a "Theater Name" enter (arbitrary) and click on the button "Initialize Campaign. In the dialog that opens, select the unzipped template file, specify a start date for the campaign and confirm with "Use This Date".
The DCS then reads the template file and if everything is right, the message "A new campaign has been created for Sector 'bliblablubb." Theater "blablabla" (with xx missions in progress). Check the situation im the MP".
Just enter the address Localhost/MP4 in Internet Explorer (! Not Firefox!) and you come to the renown choice for the SEOW sectors. The sector, which runs the from you initialized campaign is highlighted as active. Dort könnt ihr euch nun einloggen, wobei ihr beliebige Login-Daten aus der folgenden Liste der anfangs in der Datenbank enthaltenen Standard-Benutzer mit ihren Standardpasswörtern nutzen könnt. There you can log in now, and you can use any Login-Data from the following list of the standard users initially contained in the database to use their default passwords.

Code:
Commander Name Password
------------------------------- -------------------------------
Admin password Admin password
AlliedHQ london AlliedHQ london
AlliedRanks red AlliedRanks red
AxisHQ berlin AxisHQ berlin
AxisRanks blue AxisRanks blue


Now your SEOW server is ready! Trying the real possibilities of the system can begin! :)

Posted: Mon 24 Aug 2009 5:52 am
by 102nd-HR-cmirko
should be a part of wiki :) - very nice tutorial :)

cheers

Posted: Mon 24 Aug 2009 6:07 am
by II/JG54_Emil
Now what would one need to make it public?

Posted: Mon 24 Aug 2009 9:12 am
by IV/JG7_4Shades
To make it public, simply ensure that your router and PC firewall both allow TCP traffic through to the web server port (which is typically port 80). Once that is done, anyone can see your MP.

If you want public access to your DB, then you need to open TCP traffic to your MySQL port (typically 3306). You also need to establish a MySQL user account that accepts logins from the internet (the % wildcard) and give this account access permissions to your SEOW database(s).

Finally, if you want to host your SEOW coops, you need to open TCP (and possibly UDP) traffic to port 21000 on your PC, since 21000 is the default IL2 coop port.

Cheers,
4Shades

Posted: Mon 24 Aug 2009 9:52 am
by II/JG54_Emil
sounds easy lets put it this way in the SEOW-Wiki

Posted: Mon 24 Aug 2009 10:45 am
by II/JG54_Emil
I still can´t use it though as I use Windows 7 :?

Anyhow I´m going to try with an XP installation

Posted: Thu 27 Aug 2009 12:58 pm
by II/JG54_Emil
If anyone should have a good idea what causes the DCS-database-connection-problem(it doesn´t even connect to the MS Acces Database), when running under Windows 7, please let me know.

Also if anyone got it working under Vista, please tell me.

Posted: Thu 27 Aug 2009 10:07 pm
by IV/JG7_4Shades
I am trying to set up the DCS with Vista64 at the moment. The MP is working fine, but not the DCS. Stay tuned...

Cheers,
4S

Posted: Fri 28 Aug 2009 5:16 am
by II/JG54_Emil
:D

thank you

Posted: Fri 13 Nov 2009 3:23 pm
by II/JG54_Emil
Hello again,

we rented a rootserver and I finally managed to setup a MySQL on it :roll:

Well now i wonder how I can enter it externally as this is necessary for the DCS and Navycat etc..

The message I get is:
1130 - Host'e179074190.adsl.alicedsl.de' is not allowed to connect to this MySQL server
Any ideas why this is and how to avoid it?

Posted: Fri 13 Nov 2009 10:12 pm
by IV/JG7_4Shades
Hi Emil,

MySQL is a server technology that has a proper security and authentication model. By default, MySQL bars connections from remote machines. You have to enable remote access for MySQL login accounts before you can connect from another machine.

MySQL user accounts are written as "username@machine". A default example is
root@localhost
which means "root" user connecting from "localhost". To give access to Fred connecting from machine 1.2.3.4, set up a login account like:
fred@1.2.3.4
and then allocate database permissions to that account. The "%" keyword can be used to denote "all machines", so "fred@%" will mean Fred can connect from ANY computer.

Note that some server ISPs explicitly BLOCK remote connections to MySQL servers, regardless of your user account settings. If your ISP is like this, you need to negotiate with them to UNBLOCK remote access before you will be able to connect to your MySQL server remotely.

Cheers,
4S