NO_AUTO_CREATE_USER in MySQL 8.0

when ever i tried to import dumpfile in command prompt then i'm getting this error.

variable sql_mode can't be set to the value of no_auto_create_user in MySQL 8.0

Upvotes: 3

Views: 13526

Answers (1)

Luuk
Luuk

Reputation: 14958

In the MySQL docs for 5.7 is:

Previously, before NO_AUTO_CREATE_USER was deprecated, one reason not to enable it was that it was not replication safe. Now it can be enabled and replication-safe user management performed with CREATE USER IF NOT EXISTS, DROP USER IF EXISTS, and ALTER USER IF EXISTS rather than GRANT. These statements enable safe replication when replicas may have different grants than those on the source.

(source: https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_auto_create_user )

The setting NO_AUTO_CREATE_USER does not exist anymore in 8.0.

In the release notes for 8.0.11 is the following text:

The following features related to account management have been removed:

Using GRANT to create users. Instead, use CREATE USER. Following this practice makes the NO_AUTO_CREATE_USER SQL mode immaterial for GRANT statements, so it too is removed.

(source: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-11.html )

Upvotes: 7

Related Questions