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
- 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.
- Set the database name as the databases name in the MySQL server, The Table will be created inside this called "playerlogger"
- The User and password are the MySQL user name and password for the database.
- Set the Enabled to true and either Restart, Reload or /playerlogger reload to update the info.
How the Data is Stored
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.
-
View User Profile
-
Send Message
Posted Aug 17, 2012MySQL:
Enabled: true
Server: www.mysite.eu
Database: minecraft
User: root
Password: my_password
it says this in console:
2012-08-18 01:18:08 [INFO] [PlayerLogger] Enabling PlayerLogger v2.5
2012-08-18 01:18:08 [INFO] PlayerLogger v2.5 has been Enabled
2012-08-18 01:18:08 [SEVERE] java.sql.SQLException: Access denied for user 'root'@'ip-11-118.hlucinnet.cz' (using password: YES)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:931)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4031)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1296)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2338)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
2012-08-18 01:18:08 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2012-08-18 01:18:08 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
2012-08-18 01:18:08 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2012-08-18 01:18:08 [SEVERE] at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
2012-08-18 01:18:08 [SEVERE] at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
2012-08-18 01:18:08 [SEVERE] at java.sql.DriverManager.getConnection(DriverManager.java:579)
2012-08-18 01:18:08 [SEVERE] at java.sql.DriverManager.getConnection(DriverManager.java:221)
2012-08-18 01:18:08 [SEVERE] at me.mcluke300.playerlogger.playerlogger.onEnable(playerlogger.java:57)
2012-08-18 01:18:08 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215)
2012-08-18 01:18:08 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337)
2012-08-18 01:18:08 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:386)
2012-08-18 01:18:08 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:264)
2012-08-18 01:18:08 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:246)
2012-08-18 01:18:08 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:387)
2012-08-18 01:18:08 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:374)
2012-08-18 01:18:08 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:208)
2012-08-18 01:18:08 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:438)
2012-08-18 01:18:08 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
2012-08-18 01:18:08 [INFO] 0
-
View User Profile
-
Send Message
Posted Aug 18, 2012@sonic656
Yeah that as a bug in 2.7 but is fixed in 2.7.1
-
View User Profile
-
Send Message
Posted Aug 19, 2012But I'm using version 2.5 because I have 1.2.5 version of minecraft on my server because it's Tekkit server and tekkit is not using 1.3.1 version of minecraft yet
-
View User Profile
-
Send Message
Posted Aug 19, 2012Can you please fix it in this version and give me a link to download?