mariadb

Error while executing Mariadb update statement

跟風遠走 提交于 2020-06-09 03:29:09
问题 I'm using following update statement to update a row in a table of my database update department set budget = budget + 0.01 where dept_name = 'Physics'; However, running this code gives the following error: ERROR 1305 (42000): PROCEDURE university.update_budget_proc does not exist I'm not able to make anything out of this error message. I have attached the screenshot of when I type the commands in terminal. Also, to mention that I have never created any procedure 'update_budget_proc' which is

MySQL 5.5 errno: 150 “Foreign key constraint is incorrectly formed”

吃可爱长大的小学妹 提交于 2020-06-08 14:43:41
问题 There are plenty of questions regarding this error but I can't seem to find any similar scenario to what I have. My 1st table (users): My 2nd table (colleges): I am trying to alter 1st table and add a foreign key that references id of a 2nd table : ALTER TABLE users ADD CONSTRAINT FOREIGN KEY (collegelinkId) REFERENCES databaseName.colleges (id); Which fails with error (errno: 150 "Foreign key constraint is incorrectly formed") . The only parameter that is different between these two tables

How to Update a Specific Object in a JSON Array in Mysql 5.7

倾然丶 夕夏残阳落幕 提交于 2020-05-26 05:32:07
问题 How can I update an object in an array based on a unique value in the object? Let's say this is my json object stored in a table called objects and in a column called content table: objects id: 7383 content: { data:[{id: 111, active: 1 }, {id: 222, active: 1 }, {id: 333, active: 0 }] } I can update objects if I know the position of the element in the array with SET content = JSON_REPLACE(content,'$.data[1].active', 0) Where id = 7383 However, if I don't know the position of the array, but I

How to Update a Specific Object in a JSON Array in Mysql 5.7

一世执手 提交于 2020-05-26 05:31:01
问题 How can I update an object in an array based on a unique value in the object? Let's say this is my json object stored in a table called objects and in a column called content table: objects id: 7383 content: { data:[{id: 111, active: 1 }, {id: 222, active: 1 }, {id: 333, active: 0 }] } I can update objects if I know the position of the element in the array with SET content = JSON_REPLACE(content,'$.data[1].active', 0) Where id = 7383 However, if I don't know the position of the array, but I

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?' at line 1 [duplicate]

孤者浪人 提交于 2020-05-24 03:26:09
问题 This question already has answers here : MySQLSyntaxErrorException near “?” when trying to execute PreparedStatement (2 answers) Closed 3 days ago . I'm making an inventory system using Java and JDBC . I have got this error some how when querying a table. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?' at line 1 Below is the code public static

Mysql issue when creating a new user

巧了我就是萌 提交于 2020-05-23 09:54:51
问题 ( SELECT DISTINCT User , Host FROM mysql.user ) UNION ( SELECT DISTINCT User , Host FROM mysql.db ) UNION ( SELECT DISTINCT User , Host FROM mysql.tables_priv ) UNION ( SELECT DISTINCT User , Host FROM mysql.columns_priv ) UNION ( SELECT DISTINCT User , Host FROM mysql.procs_priv ) ORDER BY User ASC , Host ASC Mysql said: `#1030 - Got error 176 "Read page with wrong checksum" from storage engine Aria` [Error here][1] [1]: https://i.stack.imgur.com/PysWf.png 回答1: I too ran into the "Error:

Where is the syntax error in this MySQL stored procedure?

邮差的信 提交于 2020-05-17 08:49:19
问题 I want to set the output parameter name to the concatenated kund.Vorname and kund.Nachname. But I get a syntax error and I can't find it. I'd appreciate any help. CREATE PROCEDURE GetName(IN kartennummer CHAR(16), OUT name VARCHAR(91)) BEGIN SELECT @name = (CONCAT_WS(' ', kund.Vorname, kund.Nachname) FROM Kunden kund, Konten kont WHERE kund.KundenID = kont.KundenID AND kont.Kartennummer = kartennummer)); END; 回答1: You are closing too many brackets on line 3 回答2: First you're using name

What does the first part of the MariaDB version string mean?

天大地大妈咪最大 提交于 2020-05-17 06:45:42
问题 If I inspect the DB version information from within PHP, MariaDB returns an extra set of version numbers at the front of its version string. >>> DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION); => "5.5.5-10.2.20-MariaDB-1:10.2.20+maria~bionic" What does the 5.5.5 represent? 回答1: The version prefix (so called "replication version hack") was introduced when MariaDB bumped the major version number to 10 (2 digits). This was necessary, since the replication protocol expects a 1

Is there a way to use 'pool_reset_connection' from mysql-connector-python with MariaDB 10.4.7?

空扰寡人 提交于 2020-05-16 03:10:11
问题 I want to change my python program from a normal connection to a Connection Pool so that the database connection doesn't get lost when no queries are sent for some hours, as well as the database not being overwhelmed with a bunch of queries at once at peak usage. I'm using Python 3.7.4, mysql-connector-python 8.0.17, and MariaDB 10.4.7. It works fine when I use a normal connection, but MariaDB apparently doesn't support the pool_reset_session setting of mysql.connector.pooling

How to rename a column name in maria DB

江枫思渺然 提交于 2020-05-14 18:22:09
问题 I am new to SQL, I was trying to change column name in my database's table. I am using 'xampp' with 'maria DB' (OS - Ubuntu 18.04) I tried all of the followings: ALTER TABLE subject RENAME COLUMN course_number TO course_id; ALTER TABLE subject CHANGE course_number course_id; ALTER TABLE subject CHANGE 'course_number' 'course_id'; ALTER TABLE subject CHANGE COLUMN 'course_number' course_id varchar(255); ALTER TABLE subject CHANGE 'course_number' 'course_id' varchar(255); But the only output I