Category : mariadb

I really don’t have a clue of what is going on that i can’t filter this query, tried filter_by() and filter() both return the same error, it is probably a stupid mistake that i’m failing to notice, your help would be really appreciated. The MariaDB(MySQL) table structure is +————–+————–+——+—–+———+—————-+ | Field | Type | Null ..

Read more

I’m trying to reuse the database connection object of MariaDB, and store it as a static variable of a Singleton class. …import mariadb class SingletonAux: __connection_string = None @staticmethod def get_connection_string(): if not SingletonAux.__connection_string: #<– This part of the code never evaluates to false SingletonAux.__connection_string = mariadb.connect( user=f"{ENV-Variable}", password=f"{ENV-Variable}", host=f"{ENV-Variable}", database=f"{ENV-Variable}") return SingletonAux.__connection_string def __init__(self): ..

Read more

I want to add data to my database through python, but I do not know what to do with the ID colum. I have four colums and I only want to add the last three, the ID is counting up itself. def add_data(temp, hum): try: dt = datetime.datetime.now().replace(microsecond=0).isoformat(‘ ‘) statement = "INSERT INTO messstation (?id?,uhrzeit, ..

Read more

Sorry for my bad english, i have a small database that contains hashes of photos, when I try to find similar photos to the one below: for which the following hash was calculated: "0f3f2764ecc482c2" using the method average_hash() imagehash.average_hash(Image.open(imagePath)) The system finds a very large number of collisions, below is an example of photos that ..

Read more

I am loading bulk data using mariadb load data local in file but each time it is replacing new data with the old ones. I need to keep both old and new data in the mariadb columnstore engine data warehouse. Any help regarding this will be highly appreciable. self.log.info("Bulk inserting rows into MySQL destination…") with ..

Read more

I have built a GUI using TKinter. There I want to output the stored data and change them individually. Using the UPDATE command, I want to update the data in the table. I use MariaDB as database. I’m getting this error: Exception in Tkinter callback Traceback (most recent call last): File "C:UsersZlatanAppDataLocalProgramsPythonPython39libtkinter__init__.py", line 1892, in ..

Read more

Failing to access the temporary csv file and the error that it is giving is MySQLdb._exceptions.InternalError: (2, "File ‘/tmp/tmpc1hsxls9’ not found (Errcode: 2 – No such file or directory)"). Any suggestion regarding it will be highly appreciable. tmpfile = None with NamedTemporaryFile("wb") as tmpfile: self.log.info("Selecting rows from MySql to local file %s…", tmpfile.name) self.log.info("select mtime, ..

Read more

I use cursor.executemany for an insert query but it give me this error: Failed executing the operation; Not all parameters were used in the SQL statement. This is my code: data_hashtag = [] for emotion in hashtags_count: hashtag_count_by_emo = hashtags_count[emotion] for hashtag in hashtag_count_by_emo: count= hashtag_count_by_emo[hashtag] data_hashtag.append((emotion, hashtag, count,count)) cursor.executemany("insert into hashtagcount(Emotion, Hashtag, Count) values ..

Read more