Hi,
I am trying to install and configure DRUPAL on a WIN 2008 Server.
This is the first time we are trying to install and configure DRUPAL.
While configuring the database connection we are getting the following error.
SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'.
Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider.
•Failed to connect to your database server. The server reports the following message: SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'.
•Is the database server running? ---- YES
•Does the database exist or does the database user have sufficient privileges to create the database? ---- YES
•Have you entered the correct database name? ---- YES
•Have you entered the correct username and password? ---- YES
•Have you entered the correct database hostname? ---- YES
I have granted the user DBA privileges and am able to connect to the database using workbench.
The following are the versions we are using
Drupal – 8.5.3
MySQL – 8.0
PHP – 7.2.2
I have commented out the sql_mode in my.ini file, still we are getting the same error.
Any help in guiding us resolve this issue is much appreciated. Thanks.
Comments
Comment #2
cilefen commentedSupport for MySQL 8 isn't there yet. There's a small patch on that other issue you could try. But for the best possible experience, use MySQL 5.7 unless you are comfortable experimenting.
Comment #3
cilefen commentedComment #5
phannphong commentedI have the same problem when using MySQL Ver 8.0.13.
Who can support this?
Comment #6
cilefen commentedsee #2966523: MySQL 8 Support
Comment #7
ferrete commentedAny news about the conflict with MySQL 8?
Comment #8
mmjvb commentedConflict should be resolved:
Comment #9
vensiresThe issue should be actually solved for Drupal 8 according to #8.
Google returns this page as a first result even for Drupal 7 searches though so - in that case - you could use the following workaround:
1. Go to your settings.php file.
2. Go to your database settings array.
3. Make sure its
init_commandsmatches the following:The
sql_modedirective above contains all the values set by Drupal 7 butNO_AUTO_CREATE_USER.Comment #10
lakshmi_a commented@vensires
Thank you it's working for me.
Comment #11
mmjvb commentedFor Drupal 7 see #2978575: Mysql 8 Support on Drupal 7
It is still WIP, patch #24 should get you started. Consider D8 solution better regarding sql_mode. Recommend changing the code rather than overriding with settings.php
Comment #12
dangolk commented@lakshmi_a Yes, just confirmed that solution from @venisires worked on my local instance too! (MySQL 8.0.19 - Homebrew, Apache/2.4.41(Unix), PHP/7.3.11)
Thank you @venisires!!a
Comment #13
mkrkarthi commentedThis is working on Ubuntu 20.04 where default MySQL 8.0.20 & PHP 7.4
thank you
Comment #14
sreenivas bttv commented#9 working perfectly.
Comment #15
sajt commented@vensires #10 perfect solution for me. Lifesaving.
Comment #16
vensiresReverting the previous (I suppose accidental) version change since according to #2966523: MySQL 8 Support this issue is fixed in Drupal 8.6+.
Also set #2978575: Mysql 8 Support on Drupal 7 as a related issue to allow users coming here from search results to use the patch proposed there, hoping it will land to Drupal 7.x.
Comment #17
heni_deepak commented#9 is the perfect solution.
Comment #18
mmjvb commentedNo, #9 is not the perfect solution. This issue is already fixed, proper solution is implemented.
The workaround in #9 can be used in older versions that don't have a solution as it is not back ported.
This issue should probably have been closed as duplicate and for 8.6-dev as the solution is not provided here and fixed in 8.6.
Comment #19
Taimur_Ahmed commented#9 working perfectly for drupal 8.3
Comment #20
jaspm2004 commented#9 did it! thanks!
Comment #21
minamina commentedMerci a versires, version drupal 7.59