Closed daydayuphere closed 4 weeks ago
import psycopg2
dbname = "postgres" host = "192.168.2.199" port = "13308" user = "root" password = "root"
conn = psycopg2.connect(dbname=dbname, user=user, password=password, host=host, port=port) cur = conn.cursor()
insert_sql = """ INSERT INTO lsh_test (username) VALUES ('abolish'); """
cur.execute(insert_sql) records = cur.fetchall() for record in records: print(record)
cur.close() conn.close()
Traceback (most recent call last):
File "D:\Code\pythonProject5\psql.py", line 31, in
What is your version?
apache/shardingsphere-proxy:latest psql (PostgreSQL) 14.1
we find java version: java21, full_version=21.0.3, full_path=/opt/java/openjdk/bin/java
unadapted java version, please notice...
The port is 3308
The classpath is /opt/shardingsphere-proxy/conf:.:/opt/shardingsphere-proxy/lib/:/opt/shardingsphere-proxy/ext-lib/
main class org.apache.shardingsphere.proxy.Bootstrap 3308 /opt/shardingsphere-proxy/conf 0.0.0.0 false
[INFO ] 2024-07-24 05:22:29.446 [main] o.a.s.d.p.c.l.PipelineContextManagerLifecycleListener - mode type is not Cluster, mode type='Standalone', ignore
[INFO ] 2024-07-24 05:22:29.468 [main] o.a.s.p.v.ShardingSphereProxyVersion - Database type is PostgreSQL
, version is 14.1 (Debian 14.1-1.pgdg110+1)
, database name is postgres
[INFO ] 2024-07-24 05:22:29.469 [main] o.a.s.p.frontend.ssl.ProxySSLContext - Proxy frontend SSL/TLS is not enabled.
[INFO ] 2024-07-24 05:22:29.553 [main] o.a.s.p.frontend.ShardingSphereProxy - ShardingSphere-Proxy Standalone mode started successfully
What happen when insert failed?
why failed? My config and steps is right?
Firstly, we need to know what happen when failed, and then we can try to analyze cause.
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
I prepared table (lsh_test).
config database-encrypt.yaml like this:
databaseName: postgres
dataSources: postgres: url: jdbc:postgresql://192.168.2.199:5432/postgres username: postgres password: 123456 connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 minPoolSize: 1
rules:
!ENCRYPT tables: lsh_test: columns: username: cipher: name: username encryptorName: aes_encryptor assistedQuery: name: assisted_query_username encryptorName: assisted_encryptor encryptors: aes_encryptor: type: AES props: aes-key-value: 123456abc assisted_encryptor: type: MD5
3.try to insert new record with SQl "INSERT INTO lsh_test (username) VALUES ('abolish')", but failed
what's wrong?