MySQL problem help
#1

hi.. why i get this error in my sql?
Код:
[19:23:17] Incoming connection: 127.0.0.1:62210 id: 0
[19:23:17] [join] Test_Name has joined the server (0:127.0.0.1)
[19:23:28] [MySQL] Query Error - (ErrorID: 1364) (Handle: 1)
[19:23:28] [MySQL] Check mysql_log.txt to review the query that threw the error.
[19:23:28] Dumping query from 2016/6/4 (19:23:28)

Description: Field 'id' doesn't have a default value (index 0). Query:


[19:23:28] INSERT INTO `accounts` (`RegiDate`, `LastLogin`, `Username`, `Key`) VALUES (NOW(), NOW(), 'Test_Name','24CF1A1E02ED12BCC5261147C131D271CD22D8C17AAFAC5ECDCC4A0FF91DAD086F8BBFED48D9284B2D54D7FBABFC8DB2C748F7E0402945FD38717690B3DF09B3')
[19:25:24] [part] Test_Name has left the server (0:2)
Reply
#2

Set "id" as PRIMARY KEY with AUTO INCREMENT.
Reply
#3

How to do it? i only have many .sql files. do i open .sql in mysql and then edit it?
Reply
#4

Just run this query:
PHP код:
ALTER TABLE accounts MODIFY id INT AUTO_INCREMENT PRIMARY KEY
Reply
#5

Where to run that quary?like open it in MYSQL then do it?
Reply
#6

Hey i open .sql in MYSQL and seted primary key and now its working. i know a small mysql. so let me ask you,
if i want myself admin, i open .sql in mysql again and use:
Код:
update table accounts set  member = 1 where Username like 'Test_Name';
Reply
#7

If being a "member" with value "1" makes you admin, then yes but remove table and replace like with =
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)