Thursday, November 3, 2016

Change the Group-Office database collation and character set

Recently we converted the Group-Office database to the collation "utf8mb4_unicode_ci". We did this to support 4 byte unicode characters. Some customers may want to use another collation because of sorting in the database. For example Danish users want to use "utf8mb4_danish_ci". You can choose any collation as long as it starts with "utf8mb4".
You can use this bash script to convert all tables in the database.
Make a backup first!
#!/bin/bash
DB="go61mb4"
COLLATE="utf8mb4_unicode_ci"
USER="root"
PASSWORD="SECRET"

(
  echo 'set foreign_key_checks=0;ALTER DATABASE `'"$DB"'` \
  CHARACTER SET utf8mb4 COLLATE '"$COLLATE"';'
  mysql -u "$USER" -p"$PASSWORD"  "$DB" -e "SHOW TABLES" --batch --skip-column-names \
  | xargs -I{} echo 'ALTER TABLE `'{}'` \
  CONVERT TO CHARACTER SET utf8mb4 COLLATE '"$COLLATE"';'
) \
| mysql -u "$USER" -p"$PASSWORD" "$DB"

34 comments:

  1. Home Page
    Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.

    ReplyDelete
  2. Thank you very much for the information provided! I was looking for this data for a long time, but I was not able to find the trusted source..
    us postal address change

    ReplyDelete
  3. I regularly visit your site and find a lot of interesting information.
    Not only good posts but also great comments.
    Thank you and look forward to your page growing stronger.
    nodejs quiz , flip diving

    ReplyDelete
  4. I regularly visit your site and find a lot of interesting information.
    Not only good posts but also great comments.
    Thank you and look forward to your page growing stronger.
    nodejs quiz , flip diving

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Teracopy
    I am very comfortable and pleased to come here. Thank you very much.

    ReplyDelete
  7. I really appreciate the research you put into it..

    Best Mechanic Tool Set

    ReplyDelete
  8. Bandicam full is a program that lets you capture what's happening on your computer screen as a video o...

    ReplyDelete

  9. Adaway Apk for android is an free ad blocker for Operating program using the serves computer file.

    ReplyDelete
  10. This is very much great and hope fully nice blog. Every body can easily found her need able information. I am visit first time but I fond many use full article. Ford Mustang GT500

    ReplyDelete
  11. breaking news today provides latest news, breaking news about Pakistan, World, Sports, Cricket, Business, Health and Science.

    ReplyDelete
  12. BMW X5 Specs research prices, specs, photos, videos, and more info.

    ReplyDelete
  13. Audi R8 2019 includes minimalistic interior with a high tech master piece and features 10.5 configurable displays in traditional gauges.

    ReplyDelete
  14. This is very good information and very intructive!
    http://www.navette-paris-aeroport.com

    ReplyDelete
  15. We are a group of volunteers and starting a new initiative in a community. Your blog provided us valuable information to work on.You have done a marvellous job!

    ReactJS Online Training

    ReplyDelete
  16. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    msbi online training

    ReplyDelete
  17. So luck to come across your excellent blog. Your blog brings me a great deal of fun.. Good luck with the site.
    nocov

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. A defined list of characters recognized by the computer hardware and software. Each character is represented by a number. The ASCII character set, for example, uses the numbers 0 through 127 to represent all English characters as well as special control characters.
    qlik sense online training

    ReplyDelete
  20. Great content thanks for sharing this informative blog which provided me technical information keep posting.

    Tableau online training

    ReplyDelete
  21. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging..
    Oracle DBA Online Training

    ReplyDelete
  22. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...Resources like the one you mentioned here will be very useful to me ! I will post a link to this page on my blog.
    Sql server dba online training

    ReplyDelete
  23. Thank you very much for the information provided! You can check this website to know DEVELOPMENT OF BATITA'S COMPLETE AND ADVANCED BASIC IMMUNIZATION DATA BASIS IN EFFORTS TO IMPROVE DATA QUALITY IN BLEGA DISTRICT HEALTH CENTER, BANGKALAN DISTRICT http://repository.unair.ac.id/53840/

    ReplyDelete
  24. http://repository.unair.ac.id/53840/

    ReplyDelete