MYSQL error: Unknown column 'guid' in 'NEW' mysql

vj78 21 Reputation points
2021-04-11T03:20:26.023+00:00

I have this sql statement and it gives me error: Unknown column 'guid' in 'NEW' mysql

SQL Statement in python: INSERT INTO user (username, userpassword , admin) VALUES (%s, %s, %s )

Table structure is:
userid
username
userpassword
userguid
admin

userid is auto increment
userguid is uuid() function

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
836 questions
{count} votes

Accepted answer
  1. Anurag Sharma 17,606 Reputation points
    2021-04-14T06:25:16.697+00:00

    Hi @vj78 , thanks for your patience.

    Can you please try below code once? Here I passing 'myparams' in the same execute statement instead of new line:

    myresult = cursor.execute("INSERT INTO users (username, userpassword, userguid ) VALUES (%s, %s,  uuid())",myparams)  
    return (myresult)  
    

    Please let me know if it works.

    ----------

    If answer helps, please mark it 'Accept Answer'


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.