Conditionally inserting MySQL entries in a Flask app
def connection():


This is misnamed. Please call it cursor_connection(), as that is the tuple it returns. Some folks would prefer the identifier curs over the rather ambiguous c, as "cursor" and "connection" both start with that letter.

    c, conn = connection()
    c = conn.cursor()


Ok, that 2nd line is just bizarre. Please delete it, as the function already accomplished that task.

Nice little INSERT you have there. Be a shame if some punctuation crept into it:  https://www.xkcd.com/327/

except Exception as e:


What is your concern, here? Might be better to elide the try / catch altogether, since there isn't really any "error recovery code" here.

Rather than having mc_address_exist() return a tuple, it would be more natural to return a (potentially empty) list, or return a scalar that potentially is None (assuming the uid column is declared NOT NULL). It's not clear why you asked the DB to retrieve mc_address, since you just discard it.

In login_exist(), rather than asking for *, it would be a cheaper query to just select count(*).

You're not leaking anything with that cursor, so don't worry about closing it. You are correctly closing the underlying TCP connection. Your try/catch handling appears to be adequate for your needs at present, so no change needed.