photocode
photocode

Reputation: 750

SET SQL_MODE affect other / all databases?

I'm working on a database project that calls for an unusual need to set all table primary keys to auto increment from zero. I've been reading up on SET SQL_MODE - and the possible issues it might cause. If I run this command, will it affect the other databases on the server? Can I have databases using different SQL_MODE's on the same server?

Upvotes: 1

Views: 3040

Answers (1)

MiSHuTka
MiSHuTka

Reputation: 1312

https://dev.mysql.com/doc/refman/5.7/en/faqs-sql-modes.html#faq-mysql-sql-mode-dependency

A.3.4.

Question: Is the mode dependent on the database or connection?

Answer: A mode is not linked to a particular database. Modes can be set locally to the session (connection), or globally for the server. you can change these settings using SET [GLOBAL|SESSION] sql_mode='modes'.

Upvotes: 1

Related Questions