MySQL

PlayerLogger MySQL Tutorial

Why use MySQL

MySQL is a fast and efficient way of storing data instead of in files where when the files become big it gets slow.

Configuring PlayerLoggers MySQL

In player loggers config at the bottom is the MySQL information.

MySQL:
  Enabled: true 
  Server: localhost
  Database: minecraft
  User: root
  Password: '0000'

Steps

  1. Firstly set the server field to the MySQL server ip, in most cases it will be localhost, but it can be the information your host gives you.
  2. Set the database name as the databases name in the MySQL server, The Table will be created inside this called "playerlogger"
  3. The User and password are the MySQL user name and password for the database.
  4. Set the Enabled to true and either Restart, Reload or /playerlogger reload to update the info.

How the Data is Stored

PlayerLogger MySql Image

The Data Is firstly stored in the columns

  • id A auto counting id.
  • playername The player involved user name for console it is blank.
  • type The Type of inmation being stored, more information later.
  • time The unix time of the event which can be converted with http://www.epochconverter.com/
  • data The data involved with the event eg.The command or chat message.
  • x, y and z The coordinates involved in the event, if non available it will be 0, 0, 0.
  • world The worlds name.

Data Types

In Playerlogger there are type fields for different types of actions logged. Full list below:

  • join When a player joins the game
  • quit When a player quits the game
  • chat When a player chats
  • command When a player does a command
  • death When a player dies
  • enchant When a player enchants an item
  • bucket When a player places lava or water from a bucket
  • sign When a player places a sign
  • kill When a player kills another player
  • console When a command is issued from console
  • place When a player places a block
  • break When a player breaks a block

What uses does this have?

Querys

You can create query's to get information fast. For example is someone on my server did /smite McLuke300 and I wanted to find the culprit I could use this query.

SELECT * FROM minecraft.playerlogger
Where type='command' and data='/smite mcluke300';

or

SELECT * FROM minecraft.playerlogger WHERE type='chat' and data like '%hello%';

This then will find it, such as I got 21 McLuke300 command 1343733169 /smite McLuke300 -25 63 189 World One Meaning I smited myself at Tue Jul 31 2012 12:12:49 Using the http://www.epochconverter.com/ for the time.

The second one would find all chat messages that contain the word hello.

Other Uses

MySQL can be used for much more for example a php page that your admins can log into and search the logs instead of giving them file access to the server.

I have no idea on how to start a php database lookup page but if anyone wants to make one to share it could become the official one and would be a great help to me.

Leave Questions Below

Leave any questions below if you think I haven't covered anything that you need to know.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes