Posts

Showing posts with the label mysql-trigger

MySQL DB Procedure Execution by a non-root user

Image
In my this blog, I'll share my experience of one of the issues that I faced during procedures execution for a migration project Problem Statement Recently I have been involved in an application migration project from one cloud to another cloud. I have done the database migration and due to security reasons, I have changed the identifier of all procedures to a non-root use so that I don't need to provide root credentials. However, One strange issue encountered during the procedure execution. Below is the sample snippet of my procedure I have been executing with a non-root user- CALL save_wallet_request('233284','23342sad','1','2021-01-13 06:54:23','eeedewewqewqeqe',@out_pgref_no,@out_dup_err)     Error Code: 1449. The user specified as a definer ('root'@'%') does not exist   0.107 sec Although I have a valid identifier in my procedure i.e. 'user001@%' but still I was not able to execute the procedure. Cause The proc...

MySQL procedure Insert error “Column count doesn't match value count at row 1”

Image
Recently I have came across a strange situation in MySQL Database. I have created a MySQL procedure that uses insert statement to insert values in database table. However, It was working fine previously but all of a sudden it stopped working with below error code- Problem Error Code: 1136. Column count doesn't match value count at row 1 Normally this error indicates my insert columns have a mismatch values i.e. consider a insert statement as shown below- insert into table1(col1,col2,col3,col4,col5) values(val1,val2,val4,val5) We can clearly see that col3 has a missing value in above statement i.e. mismatch of columns and corresponding values. However this was not a case with mine. Every column has corresponding value but still same error. Cause Upon close observation of other DB objects, I saw that there was a trigger associated with the table that has missing attributes and hence the same was causing error while inserting...