Limmek / MStats-for-rust

Logs player statistics and other server stuff to MySql
https://buymeacoffee.com/Limmek
5 stars 3 forks source link

[Error] MySql handle raised an exception #1

Closed Mo45 closed 8 years ago

Mo45 commented 8 years ago

Installed plugin, edit config with tested DB, User and Pass, reloaded and get this in logs: 13:53 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) 13:53 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in <filename unknown>:0

Limmek commented 8 years ago

Try to remove the config file and database then move MStats to plugin folder and then edit the config file and reload the plugin.

Mo45 commented 8 years ago

(15:36:45) | [Oxide] 16:05 [Info] Unloaded plugin MStats v1.2.1 by Limmek (15:36:45) | [Oxide] 16:05 [Info] Loaded plugin MStats v1.2.1 by Limmek (15:36:45) | [Oxide] 16:05 [Info] [MStats] Plugin version: 1.2 Database version: 1 (15:36:45) | [Oxide] 16:05 [Info] [MStats] Opening connection. (15:36:45) | [Oxide] 16:05 [Info] [MStats] Connection opened. (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0 (15:36:45) | [Oxide] 16:05 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (15:36:45) | [Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0

Limmek commented 8 years ago

:11 [Info] [Death Notes] [SRG] SlowgamingDK killed a Stag with a Bolt Action Rifle (4x Zoom Scope) from 78.58m. 15:11 [Info] MStats was compiled successfully in 2844ms 15:11 [Info] Loaded plugin MStats v1.2.1 by Limmek 15:11 [Info] [MStats] Plugin version: 1.2 Database version: 1 15:11 [Info] [MStats] Opening connection. 15:11 [Info] [MStats] Connection opened. 15:12 [Info] [DonateCredits] Loaded Credits for MasterMAV!! 15:12 [Info] [Notifier] MasterMAV joined from Denmark 15:12 [Info] [Death Notes] [SRG] Mosberg [DK] killed a Boar with a Bolt Action Rifle (4x Zoom Scope) from 52.88m.

Mo45 commented 8 years ago

And?) I delete plugin and config, then download new one, edit config and reload it. It wont help. DB is empty

Limmek commented 8 years ago

What database are you using? xampp and mysql? I'm looking on it right now.

Mo45 commented 8 years ago

MySQL 5.7.13 on Ubuntu

Limmek commented 8 years ago

I have updated the plugin and removed "DEFAULT NULL" values. This plugin is only tested on windows 2012 R2 and latest Xampp

Mo45 commented 8 years ago

(16:36:01) | [Oxide] 17:04 [Info] MStats was compiled successfully in 2109ms (16:36:01) | [Oxide] 17:04 [Info] Loaded plugin MStats v1.2.1 by Limmek (16:36:01) | [Oxide] 17:04 [Info] [MStats] Plugin version: 1.2 Database version: 1 (16:36:01) | [Oxide] 17:04 [Info] [MStats] Opening connection. (16:36:01) | [Oxide] 17:04 [Info] [MStats] Connection opened. (16:36:01) | [Oxide] 17:04 [Error] MySql handle raised an exception in 'MStats v1.2.1' plugin (MySqlException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead) (16:36:01) | [Oxide] 17:04 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0

Limmek commented 8 years ago

Check database options i don't know if it have anything to do with that. due to the difference tween windows and ubuntu?

-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 10, 2016 at 04:05 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.5

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `mstats`
--
CREATE DATABASE IF NOT EXISTS `mstats` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `mstats`;
Mo45 commented 8 years ago

Updated version create few tables, but still have this: (16:42:33) | [Oxide] 17:11 [Error] MySql handle raised an exception (MySqlException: Table 'rust_server.player_xp' doesn't exist) (16:42:33) | [Oxide] 17:11 [Debug] at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in :0 at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32& affectedRow, System.Int64& insertedId) [0x00000] in :0

Limmek commented 8 years ago
--
-- Table structure for table `player_xp`
--

DROP TABLE IF EXISTS `player_xp`;
CREATE TABLE `player_xp` (
  `id` int(11) NOT NULL,
  `player_id` bigint(20) NOT NULL,
  `player_xp_total` float DEFAULT '0',
  `player_xp_spent` float DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `player_xp`
--
ALTER TABLE `player_xp`
  ADD PRIMARY KEY (`player_id`),
  ADD UNIQUE KEY `id` (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `player_xp`
--
ALTER TABLE `player_xp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Mo45 commented 8 years ago

Thank you. Already add all missed tables manually, Now It works!

Limmek commented 8 years ago

It is good to hear. :)