Ubuntu Error with Database but not on Debian

by KnottyCord   Last Updated November 05, 2017 18:02 PM

So I have two server and both have different OS one is Ubuntu 17 and the other one is Debian 9 Minimal (Minimal because my hosting service only has that or Debian 7). So both have the same html file and js file and php file. Every time I lunch my app on the Ubuntu server I get this error:

[2017-11-02 18:06:58.514] [ERROR] [default] - Strange error
[2017-11-02 18:06:58.515] [ERROR] [default] - { Error: ER_NO_DEFAULT_FOR_FIELD:                 Field 'pskinsurl' doesn't have a default value
    at Query.Sequence._packetToError (/var/www/Bot/node_modules/mysql/lib/protoc                ol/sequences/Sequence.js:52:14)
    at Query.ErrorPacket (/var/www/Bot/node_modules/mysql/lib/protocol/sequences                /Query.js:77:18)
    at Protocol._parsePacket (/var/www/Bot/node_modules/mysql/lib/protocol/Proto                col.js:279:23)
    at Parser.write (/var/www/Bot/node_modules/mysql/lib/protocol/Parser.js:76:1                2)
    at Protocol.write (/var/www/Bot/node_modules/mysql/lib/protocol/Protocol.js:                39:16)
    at Socket.<anonymous> (/var/www/Bot/node_modules/mysql/lib/Connection.js:103                :28)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Protocol._enqueue (/var/www/Bot/node_modules/mysql/lib/protocol/Protocol.                js:145:48)
    at Connection.query (/var/www/Bot/node_modules/mysql/lib/Connection.js:208:2                5)
    at Query._callback (/var/www/Bot/cf.js:3293:26)
    at Query.Sequence.end (/var/www/Bot/node_modules/mysql/lib/protocol/sequence                s/Sequence.js:88:24)
    at Query._handleFinalResultPacket (/var/www/Bot/node_modules/mysql/lib/proto                col/sequences/Query.js:139:8)
    at Query.EofPacket (/var/www/Bot/node_modules/mysql/lib/protocol/sequences/Q                uery.js:123:8)
    at Protocol._parsePacket (/var/www/Bot/node_modules/mysql/lib/protocol/Proto                col.js:279:23)
    at Parser.write (/var/www/Bot/node_modules/mysql/lib/protocol/Parser.js:76:1                2)
    at Protocol.write (/var/www/Bot/node_modules/mysql/lib/protocol/Protocol.js:                39:16)
    at Socket.<anonymous> (/var/www/Bot/node_modules/mysql/lib/Connection.js:103                :28)
  errno: 1364,
  sqlMessage: 'Field \'pskinsurl\' doesn\'t have a default value',
  sqlState: 'HY000',
  index: 0,
  sql: 'INSERT INTO games SET expire = 1509662218, cassetids = \'12530890030\',                 csteamid = \'76561198114317007\', cname = \'KnottyCord\', cavatar = \'https://st                eamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/1d/1d3f34eee812968fd5                548f36ee281265373ddf91_full.jpg\', cskinsurl = \'-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWw                KGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXU5A1PIYQNqhpOSV-fRPasw8rsVFx5KAVo5PSkKV4xhfG                fKTgVvIXlxNPSwaOmMLiGwzgJvJMniO-Zoo_z2wXg-EVvfSmtc78HsNoy\', cskinsnames = \'Gam                ma 2 Case\', cskinsprices = \'0.03\', cskins = 1, ctp = 0.03, cpick = \'t\', tcr                eated = 1509660418.494, hash = \'adb9037cfd700a24544d4d774189a223\', bot = \'bot                1\'' }

And on the Debian one I don't get this error.

So in the end I would like to Use Ubuntu because I'm more familiar with it.

Thank you If you need additional information just ask me.

PS: To anyone telling me that I have to specify a specific value in my code, well no because it needs to be at none because my "bot" will set the value by him self. The value depends on what the user is doing and there is a million possibilities and can't make a line of code for all of them.

Answers 1

The problem is clearly stated:

Field \'pskinsurl\' doesn\'t have a default value

You try to insert a record in a table without specifying a value for the above mentionned field and no default value is known in the table definition. The difference you observe between the two servers can come from a difference in the database server you use or in the definition of the table. So you have 3 options:

  1. Add a value for that field in the INSERT statement.
  2. Modify the definition of your table
  3. Make sure you use the same database server on both servers.
Marc Vanhoomissen
Marc Vanhoomissen
November 05, 2017 17:53 PM

Related Questions

How to create folder in mysql5.7?

Updated July 01, 2015 15:00 PM

Connection database phpmyadmin

Updated January 13, 2017 01:00 AM

Error installing mysql?

Updated August 18, 2015 18:01 PM