Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NO_AUTO_CREATE_USER in MySQL 8.0

Tags:

mysql

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

like image 200
Karasala Sai Akhil Chowdary Avatar asked Oct 25 '25 21:10

Karasala Sai Akhil Chowdary


1 Answers

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 )

like image 125
Luuk Avatar answered Oct 28 '25 11:10

Luuk