For those, who want to know,
register.conf:
user.auth=yes
user.register=yes
user.unregister=yes
accounts=yes
[user.auth]
;in my case i use as context, but you can remove "as context" and use withount it, in that case you must set in result password: result=password
account=yate
query=SELECT password as context FROM users WHERE username="${username}";
result=context
[user.register]
;here we put in table field "location" and 'expires' data
account=yate
query=UPDATE users SET location='${data}',expires='CURRENT_TIMESTAMP + INTERVAL ${expires}' WHERE username='${username}';
[user.unregister]
;Here we remove user.register data from table, if sip account unregisters
account=yate
query=UPDATE users SET location=NULL,expires=NULL WHERE expires IS NOT NULL AND username='${username}';
And mysql table: username varchar(20), password varchar(20), location varchar(50), expires varchar(50)
Insert some clients with password and try.
Here's my config for registering users through mysql.
And one more thing, you may have problem with regfile module, it can cause problems, so i disable it from yate.conf:
[modules]
regfile.yate=no