- The default charset in XAMPP should be 'Latin1', with the collation 'latin1generalci'. So it might be a good idea, to change the ' MySQL connection collation' in phphMyAdmin to this setting, too.
- Note: This page was updated showing an installation for XAMPP 1.7.1 but some older screenshots were kept. It is now October 2015 and XAMPP's current version is 5.6.8 and Moodle is 3.0 Windows is no longer supporting XP, Windows 10 is the desktop latest and greatest.
- To do this, XAMPP comes handy tools to convert your PC as a Web Server. And luckily, you can do it with a few mouse click. Before continuing to this tutorial, if your computer has not configured XAMPP then Check out here, How to Install XAMPP and Configure on your PC. And select utf8generalcias database collation. Then click on create button.
Problems with the Windows version of XAMPP, questions, comments, and anything related. Charactersetserver = utf8 secureauth = 1 local-infile = 0 skip-symbolic. As first step, considering that you have XAMPP already installed and fully functional on your own computer (the host), you will need to allow inbound connections to the Apache (HTTPD) and MySQL (MYSQLD) rules on the firewall of your computer.
I just spent about 2 days to convert my old MySQL database from latin1 / latin1_general_ci to UTF-8 character encoding. There are about a gazillion pitfalls, especially when you work on old PHP code mixed with ZF code, on a live site of a client. The first tip is… do NOT work on a live site 😉 Backup everything to a local version or a testserver, and then start to code! Fortunately, I had the site including the database on a local XAMPP environment.
For a coarse orientation, you can use the article on wordpress.org to get an overview. There is no way to change the character encoding of an entire database with just a few keystrokes, so expect it to take a tad bit longer.
For me, the following steps did the trick, using phpMyAdmin and Notepad++ (on Windows):
- Create a backup of the entire database with phpMyAdmin.
- Change your database to UTF-8 (ALTER DATABASE mydb CHARACTER SET utf8;). This will only affect new tables, so you´re not thru yet.
- Select the table(s) to change, and use the export function of phpMyAdmin.
- Copy the exported data (INSERT INTO…) without the header (CREATE…) into Notepad++.
- Change the table´s charset (ALTER TABLE mytable DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;).
- Change all fields with latin charsets to utf8_general_ci (e.g. ALTER TABLE mytable CHANGE myfield myfield TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;). Pls note that this SQL only works for TEXT fields, refer to the article on wordpress.org on how to convert ENUM, VARCHARS and so on, or use phpMyAdmin to do so for you. If you have a lot of columns with the same format to convert, just copy&paste one SQL line, and change the column names in each. Paste those lines into phpMyAdmin´s SQL editor, that´s a lot faster than doing it for each column.
- By now, you should have the table as well as all columns in UTF-8.
- Switch to Notepad++, where all you INSERTs for that table are, and convert those lines to UTF-8.
- Copy&paste it into phpMyAdmin´s SQL editor.
- Repeat steps 3 to 9 for each table, and you should have your database converted to UTF-8.
Now, that took an hour or two ;), but there´s still the website to change to the new encoding.
First, start with your meta tag:
Acronis true image 2017 new generation. Next up, if applicable, change your database connection script in PHP:
And / or if you use Zend Framework, edit your config file:
and your bootstrap:
Xampp Default Utf 8
That should do the trick, and your entire site runs on UTF-8 instead of latin.