Insert data psql user table - psql

I created psql table with below command
CREATE TABLE users(
user_id serial PRIMARY KEY,
username VARCHAR (50) UNIQUE NOT NULL,
password VARCHAR (50) NOT NULL,
email VARCHAR (355) UNIQUE NOT NULL,
created_on TIMESTAMP NOT NULL,
last_login TIMESTAMP
);
but I cannot insert any data
INSERT INTO users(user_id , username, password, email, created_on) VALUES(0, ’user999’, ‘mypassword’, ‘hello#mymail.com’,'2016-03-04','2016-01-01');

If you are using this query then remove the last login date because you have mentioned less field.
INSERT INTO users(user_id , username, password, email, created_on) VALUES(0, ’user999’, ‘mypassword’, ‘hello#mymail.com’,'2016-03-04');
Or you have to mentioned last_login in your query.
INSERT INTO users(user_id , username, password, email, created_on,last_login) VALUES(0, ’user999’, ‘mypassword’, ‘hello#mymail.com’,'2016-03-04','2016-01-01');
or you can simply use it.
INSERT INTO user VALUES(0, ’user999’, ‘mypassword’, ‘hello#mymail.com’,'2016-03-04','2016-01-01');
Hope it will help.

If you are using vagrant with laravel 5.2 with psql at your local machine e.g. mac.
vagrant#homestead:~$ psql -U homestead -h localhost
Use homestead for database connection and psql tables e.g.
DATABASE_URL
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
This will connect your vagrant or server correctly with psql database connection.

Related

freeradius sql_session_start not working using google ldap

radius won't insert any data in radacct database, only on radpostauth.
Already enabled in sites-enabled/default and mods-config/sql/main/mysql/queries.conf
radacct table is for accounting data, you must setup your supplicants to send accounting to your freeradius

Operand type clash while confirming user email

I'm trying to implement Always Encryption to our current solution and I'm having issues with entity framework. EF works fine while fetching the data but causes issues when I try to update any table. For this reason I shifted to ADO.net to test the add/update SPs but now I'm stuck at identity.
When the user tries to confirm its email await UserManager.ConfirmEmailAsync(userId, code) following error is thrown:
Operand type clash: nvarchar(max) encrypted with (encryption_type = 'RANDOMIZED', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'key',column_encryption_key_database_name = 'db') is incompatible with nvarchar(500) encrypted with (encryption_type = 'RANDOMIZED', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'key', column_encryption_key_database_name = 'db')
Statement(s) could not be prepared.
The only nvarchar(max) column in this table is SecurityStamp and I don't see why that would cause an issue as that's not encrypted. Also the email and username columns are not encrypted.

Delphi 7 + Zeos 7.1.4 + libmysql55.dll connect with PostgreSQL move to MySQL

I'm trying to get data from PostgreSQL from another computer and move to MySQL on my local computer.
I got libmysql55.dll from Zeos repository.
I had to create a program to fix a lot of mistakes over database.
One error is happening:
SQL Error: Access denied for user 'xxxx'#'localhost' (using password: YES)
I have information about: database, hostname, user and password.
ZConPropro.HostName := edtProproIP.Text;
ZConPropro.User := edtUser.Text;
ZConPropro.Password := edtPassword.Text;
ZConPropro.Database := edtDatabase.Text;
The problem is happening when I try to connect:
ZConPropro.Connected := True;
I selected protocol: PostgreSQL and after postgresql9 and nothing is happening.
I would like to know if someone has this problem and there is some parameter to change.
I'm connecting to this database with HeidiSQL without a problem...same user, password, and database.
You need postgresql client library libpqXX.dll for connection. libmysql55.dll using for MySQL only. Given error message look like MySQL error message. It is said that user xxxx successfully connected to system but it is not authorized to connect this server from localhost. You need to check mysql.user table for user xxxx host config and/or change it. Don't forget run flush privileges after any change.

Neo4j unique user node

I am making a user registration page. In this page users can enter username, name, email address and their password
I wanted to first check if the username was already taken, for this I used the following
MERGE (n:user { username: "newuser" })
ON CREATE SET n += { other properties }
RETURN n
This seems to work well. However, I actually want to check if for two fields username and email address. Basically allow new user if username and email address aren't taken.
MERGE (n:user { username: "newuser", email: "email" })
Will check for both fields and create/merge accordingly
If you want to check availability first, you should do another query for that.
To do the check
MATCH (n:user)
WHERE n.username = {newuser} OR n.email = {email}
RETURN count(n)
If it returns > 0, you're matched.

Recover sha1 password for transferring SMF members to WP users?

is it possible to recover a sha1 password (SMF part)?
I need this to convert SMF members to WP users. I am able to import/convert all the info per SMF member, only the password part isn't going well.
In smf_members table i also see a passwordSalt column, do i need this to convert the password.
At the moment i am testing with passwordpro for just one password but i can't seem to get it going and waiting 1 day seems a bit long? What i am doing wrong with this program??
Regards
SMF = Simple Machine Forum
WP = WordPress
ok i found a bit of a workaround to get SMF members to WP users by
- installing buddypress
- buddypress smf import plugin
- take a close look at the smf_password_compatibility pluginwhich converts the SMF password to WP password
$check = ( $hash == sha1( strtolower( $user_info->user_login ) . $password) );
if ( $check && $user_id ) {
// Rehash using new hash.
wp_set_password($password, $user_id);
$hash = wp_hash_password($password);
return true;
}

Resources