nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.31k stars 5.32k forks source link

MySql database support #415

Closed mariannk closed 4 years ago

mariannk commented 8 years ago

We might support MySql to draw some attention from the open source community. Sql server is a bit pricey and in some countries they just don't want to use

praveenksharma commented 8 years ago

Thanks @mariannk and @AndreiMaz

It's a must for many people.

ifeltsweet commented 7 years ago

Would really love MySql and VNext support!

fafg commented 7 years ago

I would love a generic data provider where you can implement any database as easy as possible and NGINX support. MySQL would be a nice start... NoSQL would be awesome.

fafg commented 7 years ago

change EntityFramework to Dapper and Front end from pasta code (razor) to angular or react.

AdnanCukur commented 7 years ago

When is this expected to be released ?

AndreiMaz commented 7 years ago

@AdnanCukur only after this work item - https://github.com/nopSolutions/nopCommerce/issues/2492

lanfengqi commented 6 years ago

https://github.com/lanfengqi/nopcommerce-mysql.git

nopcommerce V 4.0 --mysql support

pantonis commented 6 years ago

SQL Server is too expensive compared to MySql Community Edition which is free. Any update on this ? Any estimate? Is it implemented or not yet?

ChrisJollyAU commented 6 years ago

@pantonis probably when #2492 is done which is when #2636 is merge. Last I knew timeframe was for 4.10

AndreiMaz commented 6 years ago

also see a branch with support of SQLite - https://www.nopcommerce.com/boards/t/48993/targetting-net-core-2-aka-net-core-2-running-on-net-core-2.aspx

pantonis commented 6 years ago

So nopcommerce supports MySql now that #2492 is closed.

ChrisJollyAU commented 6 years ago

The platform is there but I believe only sql server is aimed for 4.10. Other db providers are aimed for 4.20

pantonis commented 6 years ago

So everybody is using NopCommerce with SQL Server Express right now?

VR-Architect commented 6 years ago

SQL Express is a good product and is free. It is my first go to database, then MariaDB, then MySQL, then Postgresql.

pantonis commented 6 years ago

@VR-Architect SQLExpress has important limitations

DeFault-1 commented 6 years ago

Version 4.10 is released but still no MySQL support?

On my Windows Server 2012 R2 VDS hosting plan I have only 2 GB of RAM and 60 GB of disk space.

MySQL 5.7 is installed along with PHP 5.6

Now I have only about 5 GB of unused space on my SSD disk.

SQL Server requires a minimum of 6 GB of available hard-disk space.

As millions of other users I am eagerly waiting for nopCommerce Version 4.12 with full mySQL support!

AdnanCukur commented 6 years ago

@DeFault-1 GrandNode https://github.com/grandnode/grandnode is a copy of nopCommerce and works great with mongoDb

ChrisJollyAU commented 6 years ago

Nop 4.20 is currently scheduled to have support for other sql database providers

pantonis commented 6 years ago

Nop commerce 4.2 is scheduled for next year which is way too far to wait for. :)

On Fri, 7 Sep 2018, 18:41 Christopher Jolly, notifications@github.com wrote:

Nop 4.20 is currently scheduled to have support for other sql database providers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nopSolutions/nopCommerce/issues/415#issuecomment-419479985, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJHbrDfLoTV1L6sQsceJ7pBZ17_aE4Jks5uYpORgaJpZM4HGx3J .

cnEUL commented 6 years ago

We are using the web edition of MSSQL server. it has all and some hoster rent it for about 10 or 20 EUR with support up to 8 Cores. is very easy to maintain with the free ssms. And it can support a lot of nopcommerce shop systems on one physical host. In any case it is a cheep alternativ in the actual situation.

pantonis commented 6 years ago

From where do you get the host of web edition?

On Fri, 7 Sep 2018, 19:29 Christian Niedergesäß, notifications@github.com wrote:

We are using the web edition of MSSQL server. it has all and some hoster rent it for about 10 or 20 EUR with support up to 8 Cores. is very easy to maintain with the free ssms. And it can support a lot of nopcommerce shop systems on one physical host. In any case it is a cheep alternativ in the actual situation.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nopSolutions/nopCommerce/issues/415#issuecomment-419494041, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJHbp-PgvlGlkIsBi17wCO6mUUMyTSBks5uYp7VgaJpZM4HGx3J .

cnEUL commented 6 years ago

We are using the www.hosteurope.de as hosting provider. And they have that option with their rootserver. the web edition supports much memory, cores, agent and lot of other fine stuff. Also the backup is supported in compressed mode.

pantonis commented 6 years ago

I dont see any option for sql server.

On Fri, 7 Sep 2018, 19:53 Christian Niedergesäß, notifications@github.com wrote:

We are using the www.hosteurope.de as hosting provider. And they have that option with their rootserver. the web edition supports much memory, cores, agent and lot of other fine stuff. Also the backup is supported in compressed mode.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nopSolutions/nopCommerce/issues/415#issuecomment-419501069, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJHbhr08VueZFg-8sNvRc_jXzjoNEosks5uYqSggaJpZM4HGx3J .

cnEUL commented 6 years ago

Yes not easy to find... i will call them tomorrow in the german office time. sql (for any two cores we pay actually 10 EUR, based on a root server with windows datacenter and SSD its a very fast thing)

cnEUL commented 6 years ago

I found a link in this moment, its for reseller and doc is in german. But with www.deepl.com you get a very good translation.

There you find a section for the web edition as reseller, only 8,40 EUR. https://www.hosteurope.de/download/PVL/Leistungsverzeichnis_Reseller_Level_L_final_v1.5.pdf

turgayozgur commented 6 years ago

I added the MySQL Support for 4.1 version with minimum code changes. Some features like full text searching and some options at product search page not implemented yet.

Here is the code: https://github.com/turgayozgur/nopCommerce

Just, use the master branch to run the nopCommerce on MySQL database.

image

JwanKhalaf commented 5 years ago

Anyone know when official support is coming for MySQL and Postgres? I mean in terms of time frame, are we looking at 2020? Or sometime early 2019?

TopsDesk commented 5 years ago

Hi turgayozgur - While MariaDB and MySQL are very similar but recently MariaDB with Replication is changing course. Have you tested it with MariaDB with Replication Servers? Specifically I want to know if there is any dependency on auto increment of primary keys? How have you handled any need for autoincrement of primary keys? Dome detail will help. I am testing your updates and will keep you posted.

turgayozgur commented 5 years ago

Hi turgayozgur - While MariaDB and MySQL are very similar but recently MariaDB with Replication is changing course. Have you tested it with MariaDB with Replication Servers? Specifically I want to know if there is any dependency on auto increment of primary keys? How have you handled any need for autoincrement of primary keys? Dome detail will help. I am testing your updates and will keep you posted.

Hi @ekuiperemr, I haven't tested with it. I dont understand exactly what you are point when you are saying pk dependencies but no, I havent handled anything about pk. Still they are auto incremented without any manual handling as usual. Dont forget checkout my last commit to fix linux build issue.

TopsDesk commented 5 years ago

Hi turgayozgur - While MariaDB and MySQL are very similar but recently MariaDB with Replication is changing course. Have you tested it with MariaDB with Replication Servers? Specifically I want to know if there is any dependency on auto increment of primary keys? How have you handled any need for autoincrement of primary keys? Dome detail will help. I am testing your updates and will keep you posted.

Hi @ekuiperemr, I haven't tested with it. I dont understand exactly what you are point when you are saying pk dependencies but no, I havent handled anything about pk. Still they are auto incremented without any manual handling as usual. Dont forget checkout my last commit to fix linux build issue.

Thanks for your response. I just downloaded https://github.com/turgayozgur/nopCommerce on a linux server. While I have good understanding on Windows how to build an app but not on linux.

So I installed DotNet using https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-current

To build your source, have you documented any steps on the forum? If yes that will greatly save me some time.

Regards, Farooq Khan

turgayozgur commented 5 years ago

No any steps required. Just run the dotnet build command inside the src folder which is contains .sln file. Then you will be able to run the command dotnet run inside the folder Presentation/NopCommerce.Web. For production env. you can use the these commands like dotnet build -c Release and dotnet run /path/to/dll/NopCommerce.Web.dll

If you want to deploy your .net core package from local/ci tool to linux server(zero downtime), check the medium post that shared from me.

TopsDesk commented 5 years ago

Thank once again - I executed

dotnet build That built all the files Note : Nop.Plugin.Payments.Worldpay -> /var/www/fivecent/nopCommerce/src/Presentation/Nop.Web/Plugins/Payments.Worldpay/Nop.Plugin.Payments.Worldpay.dll

and then executed t/nopCommerce/src# d dotnet run --project ./Presentation/Nop.Web

To get error :
Unhandled Exception: System.Exception: Plugin 'Credit Card'. Could not load file or assembly '/var/www/fivecent/nopCommerce/src/Presentation/Nop.Web/Plugins\bin/Nop.Plugin.Payments.Worldpay.dll'. The system cannot find the file specified.

This file /Nop.Web/Plugins\bin/Nop.Plugin.Payments.Worldpay.dll Is in these folders

root@fdb01:/var/www/fivecent/nopCommerce/src# find . -name "Nop.Plugin.Payments.Worldpay.dll" ./Plugins/Nop.Plugin.Payments.Worldpay/obj/Debug/netcoreapp2.1/Nop.Plugin.Payments.Worldpay.dll ./Presentation/Nop.Web/Plugins\bin/Nop.Plugin.Payments.Worldpay.dll ./Presentation/Nop.Web/Plugins/Payments.Worldpay/Nop.Plugin.Payments.Worldpay.dll

Not sure how to fix this?

Regards, Farooq Khan

ChrisJollyAU commented 5 years ago

That looks like path handling problem to me. While Windows will accept both unix style and Windows style paths, Linux will only accept unix style paths

Note the one "Plugins\bin" is using windows style

You may have to locate where nopcommerce manages that part of the path and change it to unix style

If I remember correctly I think there are other areas that also need changing from windows to unix style otherwise you will have problems there


From: ekuiperemr notifications@github.com Sent: Tuesday, 29 January 2019 6:35 AM To: nopSolutions/nopCommerce Cc: Christopher Jolly; Comment Subject: Re: [nopSolutions/nopCommerce] MySql and PostgreSQL support (#415)

Thank once again - I executed

dotnet build That built all the files Note : Nop.Plugin.Payments.Worldpay -> /var/www/fivecent/nopCommerce/src/Presentation/Nop.Web/Plugins/Payments.Worldpay/Nop.Plugin.Payments.Worldpay.dll

and then executed t/nopCommerce/src# d dotnet run --project ./Presentation/Nop.Web

To get error : Unhandled Exception: System.Exception: Plugin 'Credit Card'. Could not load file or assembly '/var/www/fivecent/nopCommerce/src/Presentation/Nop.Web/Plugins\bin/Nop.Plugin.Payments.Worldpay.dll'. The system cannot find the file specified.

This file /Nop.Web/Plugins\bin/Nop.Plugin.Payments.Worldpay.dll Is in these folders

root@fdb01:/var/www/fivecent/nopCommerce/src# find . -name "Nop.Plugin.Payments.Worldpay.dll" ./Plugins/Nop.Plugin.Payments.Worldpay/obj/Debug/netcoreapp2.1/Nop.Plugin.Payments.Worldpay.dll ./Presentation/Nop.Web/Plugins\bin/Nop.Plugin.Payments.Worldpay.dll ./Presentation/Nop.Web/Plugins/Payments.Worldpay/Nop.Plugin.Payments.Worldpay.dll

Not sure how to fix this?

Regards, Farooq Khan

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FnopSolutions%2FnopCommerce%2Fissues%2F415%23issuecomment-458329606&data=02%7C01%7C%7C31edb61fd3594274be2608d68570e075%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636843117173632866&sdata=eQWREUEg0Aye1ZaHzaP5CNqJhQntsJnQtlzjIbEm%2FmU%3D&reserved=0, or mute the threadhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARjLNvVej5QKlAP4HNijuo5NCBBqU_kCks5vH3sjgaJpZM4HGx3J&data=02%7C01%7C%7C31edb61fd3594274be2608d68570e075%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636843117173642871&sdata=Idne53mDylDXShcgeF2of5zEG513XwvypIPCuMdiJK0%3D&reserved=0.

TopsDesk commented 5 years ago

I deleted entire nopCommerce directory and

git clone https://github.com/nopSolutions/nopCommerce.git

Followed by

dotnet build /nopCommerce/src# dotnet run --project Presentation/Nop.Web

That was successful - I see


Hosting environment: Development Content root path: /var/www/fivecent/nopCommerce/src/Presentation/Nop.Web Now listening on: http://localhost:55390


I can see that this is fixed in DotNet on github in a different bug. https://github.com/dotnet/docs/pull/4182

Is there a way I can only take the files which are modified for MySQL support and merge these to nopCommerce using Git ? Basically will be merging nopSolutions/nopCommerce and your fork turgayozgur/nopCommerce

TopsDesk commented 5 years ago

A bit of research about GIT

I created a fork of nopSolutions/nopCommerce Created a PULL REQUEST on the web for turgayozgur/nopCommerce and auto merged the two over the web Cloned the ekuiperemr/nopCommerce

dotnet clean cd src dotnet build dotnet run --project Presentaion/Nop.Web now runs the app Nop.Web - Testing further for MySQL Support with DotNet 2.2 Ubuntu 18.04 MariaDB with 3 replication servers Will keep posted.

JTrotta commented 5 years ago

@ekuiperemr I did some test with MySql and Postgres. They both works on Windows and Linux except full-text-search (not implemented and tested). I do not agree in creating a data plugin Nop.Plugin.Data.MySQL.Data , the best way is to add provider into Nop.Data.

TopsDesk commented 5 years ago

Thanks jTrotta for this information. Which branch/version should I take to test MySql on UBUNTU 18.04 Regards.

JTrotta commented 5 years ago

@ekuiperemr I got the master, and then applied some few changes to it. Of course you have to add Npgsql.EntityFrameworkCore.PostgreSQL and MySql.Data.EntityFrameworkCore

TopsDesk commented 5 years ago

@ekuiperemr I got the master, and then applied some few changes to it. Of course you have to add Npgsql.EntityFrameworkCore.PostgreSQL and MySql.Data.EntityFrameworkCore

Are your changes available on any branch/fork ? That I can use - that will greatly help.

Thanks,

TopsDesk commented 5 years ago

I am using Ubuntu 18.04 with Dotnet 2.2 with simply the master branch of nopCommerce from GIT using Nginx. So nothing fancy just verbatim master - When access it from a web browser - I see the following error - which is a very good sign that tells me that NGINX is working - DotNet is working and this code is working to an extent. The error shows as following - Not sure this issue is fixed in the dev branch or not. Next I am trying the dev branch and then will see if I need to merge mysql code from @turgayozgur or not. Any help in resolving this run time error will be greatly appreciated. I am continuing on making it work on Linux with MariaDB

DirectoryNotFoundException: Could not find a part of the path '/var/www/fivecent/master/src/Presentation/Nop.Web/App_Data\Localization\Installation\'.

update: Just built and ran with develop branch and got the same results. This bug needs to be fixed. Trying to find it.

JTrotta commented 5 years ago

Very easy. Check MapPath separator. Window accept / and \ while Linux only /. Search for Mappath and change separator depending in platform

TopsDesk commented 5 years ago

Very easy. Check MapPath separator. Window accept / and \ while Linux only /. Search for Mappath and change separator depending in platform

Thanks - but where ? Apparently this code works on Linux because @turgayozgur has shown a screenshot and has updates in his code for Linux Builds. I think I am making some silly mistake during build and perhaps I do nto need to change any code to make the MapPath Separator work.

Can someone who has successfully built on Linux provide that secret TIP ?

turgayozgur commented 5 years ago

@ekuiperemr I did some test with MySql and Postgres. They both works on Windows and Linux except full-text-search (not implemented and tested). I do not agree in creating a data plugin Nop.Plugin.Data.MySQL.Data , the best way is to add provider into Nop.Data.

There is no issue with creating new plugin. This is the best way you can do that with minimum code change. Also I changed some other lines inside the nopCommerce code you can view in this commit.

Very easy. Check MapPath separator. Window accept / and \ while Linux only /. Search for Mappath and change separator depending in platform

Thanks - but where ? Apparently this code works on Linux because @turgayozgur has shown a screenshot and has updates in his code for Linux Builds. I think I am making some silly mistake during build and perhaps I do nto need to change any code to make the MapPath Separator work.

Can someone who has successfully built on Linux provide that secret TIP ?

I was created a branch named linux before but I totally forgot it. Sorry about that. Now, I merged the linux branch to master. Lets pull the master branch again. Now, you will be able to run on linux.

TopsDesk commented 5 years ago

YESS!!! Thanks @turgayozgur - After this merge of linux branch, both build and run were successful I can see the 1st installation screen. Thanks indeed.

How complete is your MySQL Plugin?

1st Install Screen displayed Entered initial parameters with NO Sample Data and clicked INSTALL

INSTALL ran for a while and came back with this error:

Setup failed: Value cannot be null. Parameter name: hashAlgorithm

Thanks for the help so far.

turgayozgur commented 5 years ago

I successfully installed again on my local macos machine. Have you tried with clean start? I mean no database and empty DataConnectionString field at Presentation/Nop.Web/App_Data/dataSettings.json?

The issue probably about updating customer password after installation when you haven't yet the setting customersettings.hashedpasswordformat on db.

Also, have you tried just my fork of nopCommerce or merge something else in it?

TopsDesk commented 5 years ago
  1. Deleted Directory master where everything was present
  2. git clone https://github.com/turgayozgur/nopCommerce.git
  3. cd nopCommerce
  4. cd src
  5. dotnet build
  6. everything got built without errors - only 1 warning
  7. drop database nopfivecent ; from mysql - this is the database I am using
  8. Udated all files and directories as 777 so that any read or write will succeed
  9. dotnet run --project Presentation/Nop.Web Got: Now listening on: http://localhost:55390 Application started. Press Ctrl+C to shut down.

On the browser Got Install page image

Clicked Install and got image

On the console: it shows

info: Microsoft.EntityFrameworkCore.Database.Command[20101] Executed DbCommand (311ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] SELECT stringValue.Value FROM ( SELECT table_name AS Value FROM INFORMATION_SCHEMA.TABLES WHERE table_type = 'BASE TABLE' ) AS stringValue fail: Microsoft.EntityFrameworkCore.Database.Command[20102]

And in the database nopfivecent there are no tables.

TopsDesk commented 5 years ago

What dotnet version are you using? Mine is 2.2.1

turgayozgur commented 5 years ago

I am using 2.2.101 sdk.

Need more information.

TopsDesk commented 5 years ago

I am on Linux lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.10 Release: 18.10 Codename: cosmic

mysql Ver 15.1 Distrib 10.3.11-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

dotnet --version 2.2.103

TopsDesk commented 5 years ago

Thanks @turgayozgur

With the steps I toook above - I was using a dbname of nopfivecent. With your help, once we used dbname of nopdata - everything went fine and NopCommerce got installed correctly. That means dbname of nopata is hard coded some where.

Next issue came was that there was no CSS. That is because NGINX was not configured for this application - I plan to add a service using your script from https://gist.github.com/turgayozgur/4d9dbbc39dbe30aef2ac84b44a9e18bb

Will provide the application path to it.

With the domain name pointing to the correct path. So far Nop is working reasonably well. With Google Pagespeed of 96 from a $5 vultr.com server.

I need to further test it with Maria DB replication server.

Thanks again for your help. I support the idea of MySQL/MariaDB through a plugin.

Regards, Farooq Khan