Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup failed: Fatal error encountered during command execution. [Mysql] #4691

Closed
kingsjakal opened this issue May 5, 2020 · 3 comments
Closed

Comments

@kingsjakal
Copy link

nopCommerce version: 4.30

Steps to reproduce the problem:
Fresh installation
-> Added mysql connection string "Server=localhost;Port=3308;Database=nopcommerce;Uid=xxxxx;Pwd=xxxxxx;"
-> It says intalling
-> I able to see the tables that are created in mysql server
image

In console
image

-> After the above log i am getting the following fatal error, it is happening only for mysql based installation, for mssql it is working fine
image

@kingsjakal
Copy link
Author

HI Found the root cause of the issue,

From the following path
nopcommerce\src\Libraries\Nop.Data\MySqlDataProvider.cs
attached snippet line number trying to create the store procedure in MySql

image

from the list of stored procedure, the below is the one of the store procedure throwing the error in mysql 8.0

CREATE PROCEDURECreate_FullText_Index( TableName varchar(200), ColumnNames varchar(600), IndexName varchar(200), outResult bool ) MODIFIES SQL DATA sql security invoker BEGIN setResult= true; select if ( Check_Exists_FullText_Index(TableName, IndexName) ,'select false into @stmt_result' , concat('CREATE FULLTEXT INDEX ', IndexName, ' ON ', TableName, '(', ColumnNames, ');')) into @a; PREPARE stmt1 FROM @a; EXECUTE stmt1; DEALLOCATE PREPARE stmt1; Set Result = @stmt_result; END

I have manually installed the script from
nopcommerce\src\Presentation\Nop.Web\App_Data\Install\MySQL.StoredProcedures.sql
after the table creation and it started to work.

If the person is not a developer who is installing the nopcommerce using mysql then he cant use the application, it is bug please review the code

@exileDev
Copy link
Contributor

exileDev commented May 6, 2020

@kingsjakal The fact is that you didn't specify the Allow User Variables = True parameter in your RAW connection string. These stored procedures use User Defined Variables in SQL statements.

@exileDev
Copy link
Contributor

exileDev commented May 7, 2020

Closed #4691

@exileDev exileDev closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants