Forums / Installing on a Windows Server / Database Restore Issue on XAMPP localhost

Database Restore Issue on XAMPP localhost

Views: 9,894

Results 1 to 9 of 9
23 Oct 2021, 10:24 PM
#1
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Database Restore Issue on XAMPP localhost

I have a XAMPP localhost set up and was attempting to the database backup created by my site's Database Backup tool. I have never seen this error before. Here is the error I am getting:

MySQL said: Documentation

#1273 - Unknown collation: 'utf8mb4_0900_ai_ci'

????

23 Oct 2021, 10:31 PM
#2
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Re: Database Restore Issue on XAMPP localhost

I did find one reference that recommends opening the file in a text editor and modifying the entries.

https://tecadmin.net/resolved-unknown-collation-utf8mb4_0900_ai_ci/

I did open the SQL file in Notepad++ and that collation is used in numerous places throughout the file.

24 Oct 2021, 12:12 AM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Database Restore Issue on XAMPP localhost

May want to provide more information about your XAMP setup, while this site is predominantly for the care of the eCommerce software and database, there may be more assistance available to help.

Right now it looks like either a table or portion of the database has been defined to a collation that just doesn't exist or to one that is not supported by the installed software... in either case it should be resolvable.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

24 Oct 2021, 12:24 AM
#4
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Re: Database Restore Issue on XAMPP localhost

mc12345678:

May want to provide more information about your XAMP setup, while this site is predominantly for the care of the eCommerce software and database, there may be more assistance available to help.

Right now it looks like either a table or portion of the database has been defined to a collation that just doesn't exist or to one that is not supported by the installed software... in either case it should be resolvable.

phpAdmin 5.1

Server: 127.0.0.1 via TCP/IP
Server type: MariaDB
Server connection: SSL is not being used Documentation
Server version: 10.4.21-MariaDB - mariadb.org binary distribution
Protocol version: 10
User: root@localhost
Server charset: UTF-8 Unicode (utf8mb4)

XAMPP for Windows 7.4.25

Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/7.4.25
Database client version: libmysql - mysqlnd 7.4.25
PHP extension: mysqli Documentation curl Documentation mbstring Documentation
PHP version: 7.4.25

24 Oct 2021, 1:03 AM
#5
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Re: Database Restore Issue on XAMPP localhost

Okay, its a new install, so I can always just redo the whole thing. I followed only half the info in the above link replacing all 120 instances of utf8mb4_0900_ai_ci with utf8mb4_general_ci.

The import seem to go without a hitch. The data seems intact. Does anyone know the specifics between the two different collations?

Thanks
Chris

24 Oct 2021, 3:47 PM
#6
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Database Restore Issue on XAMPP localhost

utf8mb4_0900_ai_ci
Never seen that before....probably because no it is not in a Xampp setup at the moment, so yes it probably would complain when trying to import a database that specifies it.

No doubt Xampp will add this in the near future and you wont have a problem.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

24 Oct 2021, 4:22 PM
#7
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Re: Database Restore Issue on XAMPP localhost

torvista:

utf8mb4_0900_ai_ci
Never seen that before....probably because no it is not in a Xampp setup at the moment, so yes it probably would complain when trying to import a database that specifies it.

No doubt Xampp will add this in the near future and you wont have a problem.

Just did some checking...that data is hosted on MySQL version 8. XAMPP is using MariaDB so this could be the issue. So far, I have not had any issues making the conversion above.

28 Oct 2021, 4:53 AM
#8
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Database Restore Issue on XAMPP localhost

Found this information

What is the meaning of the MySQL collation utf8mb4_0900_ai_ci?

uft8mb4 means that each character is stored as a maximum of 4 bytes in the UTF-8 encoding scheme.
0900 refers to the Unicode Collation Algorithm version. (The Unicode Collation Algorithm is the method used to compare two Unicode strings that conforms to the requirements of the Unicode Standard).
ai refers accent insensitivity. That is, there is no difference between e, è, é, ê and ë when sorting.
ci refers to case insensitivity. This is, there is no difference between p and P when sorting.

utf8mb4 has become the default character set, with utf8mb4_0900_ai_ci as the default collation in MySQL 8.0.1 and later. Previously, utf8mb4_general_ci was the default collation. Because the utf8mb4_0900_ai_ci collation is now the default, new tables have the ability to store characters outside the Basic Multilingual Plane by default. Emojis can now be stored by default. If accent sensitivity and case sensitivity are required, you may use utf8mb4_0900_as_cs instead.

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

28 Oct 2021, 9:46 AM
#9
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Re: Database Restore Issue on XAMPP localhost

barco57:

Found this information

What is the meaning of the MySQL collation utf8mb4_0900_ai_ci?

uft8mb4 means that each character is stored as a maximum of 4 bytes in the UTF-8 encoding scheme.
0900 refers to the Unicode Collation Algorithm version. (The Unicode Collation Algorithm is the method used to compare two Unicode strings that conforms to the requirements of the Unicode Standard).
ai refers accent insensitivity. That is, there is no difference between e, è, é, ê and ë when sorting.
ci refers to case insensitivity. This is, there is no difference between p and P when sorting.

utf8mb4 has become the default character set, with utf8mb4_0900_ai_ci as the default collation in MySQL 8.0.1 and later. Previously, utf8mb4_general_ci was the default collation. Because the utf8mb4_0900_ai_ci collation is now the default, new tables have the ability to store characters outside the Basic Multilingual Plane by default. Emojis can now be stored by default. If accent sensitivity and case sensitivity are required, you may use utf8mb4_0900_as_cs instead.

Perfect! And my new database is MySQL 8 so this makes total sense. I just did a search and replace to replace utf8mb4_0900_ai_ci with utfmb4_0900_general_ci based on the recommendation in the article above. While it seems to have "worked" I was worried that it would cause an issue somewhere down the line. I do not have any accented characters anyway.

My mind is much more at ease now. Great Explanation! Thanks!