question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting up a Blog template on Piranha CMS using MySQL Db/Identity

See original GitHub issue

Hello @tidyui

I think that I might’ve found (and possibly resolved) a new? issue.

I have tried setting up a new project. I’ve tried following the instructions from this page: Blog Template

Changing the Startup.cs file to be using <IdentityMySQLDb> led to this problem (before it was run initially).

2018-12-14 11_49_39-holtdoctors - microsoft visual studio administrator

When I ran the command dotnet run it exited with an error, trying to execute the following command:

CREATE UNIQUE INDEX IX_Piranha_Aliases_SiteId_AliasUrl ON Piranha_Aliases (SiteId, AliasUrl);

I did some googling and found out that the error that I was getting #1071 - Specified key was too long; max key length is 767 bytes

And I thought that the solution was this: You have to change the VARCHAR to 255 (from 256) to make it work. Yeah, it worked for creating the index, but then it had more problems. So, what I found next was changing the collation.

Using the collation “latin1_bin” solves the problem.

I think it is because it uses 1 byte per character, while utf8_bin (which I tried first) uses 3 bytes per character.

I did not find where the SQL execution commands are stored, but maybe changing them globally to use VARCHAR(255) fields or just another collation will solve it for future problems.

I can still add some information if the provided is not sufficient

P.S. - Running it on localhost with: 10.1.37-MariaDB UTF-8 Unicode Apache/2.4.37 PHP: 7.2.12 on XAMPP P.S.2 - Can you please my other issue with the posts access, please? I have reopened it.

Best Regards, Chris

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tidyuicommented, Jan 24, 2019

This hasn’t been tested or released yet so let’s keep it open. We’ll try to get it done for the next release

1reaction
tidyuicommented, Jan 6, 2019

I will make a test and see what happens if I change all of the already existing migrations and db setup to use a maximum of 255 chars instead of 256. Hopefully EF Core will not consider the migrations changed meaning that all new databases will be created with the new max length, but existing databases will be left alone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing the new Blog Template
After the template has been successfully installed you can create a new project by standing in an empty folder and type. dotnet new...
Read more >
Project Templates
The templates are used to create a new project from scratch and not to add CMS ... NET Core are installed from the...
Read more >
Project Templates
Creates an application for ASP.NET MVC with some default Content Types and Views . When starting the application for the first time you...
Read more >
MySQL
To use MySQL you need to add the NuGet package for running Piranha with Entity Framework Core and MySQL . PM> install-package Piranha.Data.EF.MySql...
Read more >
Project Setup
This section shows how to setup and configure Piranha in your Application Startup and is intended for users who wants to create their...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found