Search Posts

Month: October 2017

Lock not being acquired despite no other transactions holding the lock

In the snippet of the innodb lock logs below I have 3 transactions all waiting for a lock on TABLE_C to be able to insert rows. Something is preventing any of them from getting the lock, so all of the queries timeout and the transactions are rolled back. Oct 31 17:23:40 QA mysqld: LIST OF TRANSACTIONS FOR EACH SESSION: Oct 31 17:23:40 QA mysqld: —TRANSACTION 233954056, not started Oct 31 17:23:40 QA mysqld: MySQL thread […]

Is it better to create users on MySQL or refer to the database directly?

So I am making a corporate directory for class, which is simply a search function that allows one (depending on their privileges) to view information about other employees. I am using MySQL and accessing that through PHPMyAdmin. The question is about users. I know I can create users directly on PHPMyAdmin who have different privileges with the "users" function, but I will obviously have many people on the database since it emulates a corporate environment. […]

Eloquent ORM Model Two or More Table

I have a problem that I couldn’t deal with it. I have a News table includes TitleID, TextID, ImageID. And three more tables Titles, Texts, Images. I want to get all of them in one model. But when I try, got result like array in array . But I want it like: [ News: [ { ID, Title, Text, Image } ] ] Eloquent ORM responds it like: [ News: [ { ID, Title: [ID, […]

Confused with table structure

I’m working on an inventory system where I save information about products in MariaDB. The products are stored in a table ‘article’, and every product has a uniqe ID. I have another table ‘stocks’, which holds information about articles, namely amount and insert date. The insert date is important, because it should be possible to have the same article in the database twice but with different insert dates. For example, you buy two apples on […]

Can’t connect to mysql database via command

maybe I’m just missing something very obvious but I can’t somehow connect to my mysql database which is installed on my local computer. When I open mysql.exe it says I’m connected to MariaDB and an ID. But when I try to access a certain database I get: “ERROR 1044 (42000): Access denied for user ”@’localhost’ to database …” When I check for status, it says I’m connected as a user that has the name of […]

How to convert integer list into range in SQL/mariadb?

I have an similar problem to: converting a list of integers into range in python But i have a small difference. I have realtively large mariadb database where i have a table of jobs to be done: Table: CREATE TABLE blocks ( block_num INTEGER, data_state TINYINT, PRIMARY KEY(block_num)); Every entry for which data_state is Null the block_num has to be processed by a python function. SELECT block_num FROM blocks where data_state IS NULL I have […]

mariadb : Relay log write failure

I am currently trying to get a MariaDB 10.2.9 to run as a slave of a mysql 5.5 master but i keep getting the same error (Last_IO_Errno: 1595, Relay log write failure: could not queue event from master) As there is some difference in version between master and slave i had to set set global binlog_checksum=’NONE’; All in all i took a mysqldump of the master, read the log_pos/file and SET GLOBAL server_id=2; CHANGE MASTER […]

maria DB connection issue

I am facing below issue when cconnecting to mariaDb through Talend Exception in component tMysqlConnection_2 java.sql.SQLException: Host ‘xx.xx.xx.xx’ is not allowed to connect to this MariaDB server at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:149) at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106) at org.mariadb.jdbc.Driver.connect(Driver.java:114) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at local_project.bokka_0_1.bokka.tMysqlConnection_2Process(bokka.java:321) at local_project.bokka_0_1.bokka.runJobInTOS(bokka.java:586) at local_project.bokka_0_1.bokka.main(bokka.java:443) Caused by: org.mariadb.jdbc.internal.common.QueryException: Host ‘10.207.0.39’ is not allowed to connect to this MariaDB server at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connect(MySQLProtocol.java:398) at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connect(MySQLProtocol.java:673) at org.mariadb.jdbc.internal.mysql.MySQLProtocol.<init>(MySQLProtocol.java:266) at org.mariadb.jdbc.Driver.connect(Driver.java:110) … 5 more Could someone help me resolve […]

Python insert loop to mariadbdb not working

I try to insert my data, but after my command update, the loop is finished. So then I remove my update query the loop continues, I don’t understand why? #!/usr/bin/python import mysql.connector as mariadb from subprocess import Popen, PIPE, STDOUT import re import os mariadb_connection = mariadb.connect(user=’root’, password=’xxxx’, database=’xxxx’); cursor = mariadb_connection.cursor(buffered=True) #retrieving information cursor.execute(“SELECT Domain,Id FROM classement where Domain like ‘%com’;”) for Domain,Id in cursor: counter=0 for character in Domain: if (character == “.”): […]

Next Page »