Вопрос

When I tried to create user with store_salt to FALSE it is giving below error

$config['salt_length'] = 10;
$config['store_salt']  = FALSE;

Here is the error

Error Number: 1364

Field 'salt' doesn't have a default value

INSERT INTO `users` (`first_name`, `last_name`, `company`, `phone`, `username`, `password`, `email`, `ip_address`, `created_on`, `last_login`, `active`) VALUES ('xxx', 'yyy', 'zzz', '466', 'xxx.yyy', '', 'xxx@yyy.com', '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', 1385641604, 1385641604, 1)

Filename: C:\xampp\htdocs\atlas-dev\system\database\DB_driver.php

Line Number: 330

When I tried with store_sal to TRUE it is not giving error but than it is not considering the password correct and user cannot login.

Can you help to resolve this?

Это было полезно?

Решение

Error Number: 1364 occurs most probably due to default not set or null value not allowed.

Change the salt field from "NOT NULL" to "ALLOW NULL".

ALTER TABLE users MODIFY salt varchar(40) null;

This should reset it's default to "ALLOW NULL", allowing you to insert a record without a value for salt field

If salt is used ,

$config['store_salt']  = TRUE;

It will change your password encryption algorithm, default password, 'password', changes to fbaa5e216d163a02ae630ab1a43372635dd374c0 with default salt.

Другие советы

This 'store_salt' setting obviously tells Ion Auth whether to insert something in the salt field or not. The problem is that this field doesn't have a default value and you're not inserting anything into it. So, either alter the field definition to have a default value or use a salt.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top