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"

14 comments:

  1. This comment has been removed by the author.

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

    ReplyDelete
  3. For most people in India, 50,000 still remains an unbelievably large amount. India is a poor country with very low per capita income. So in general, it is a very good salary. ... You can fulfil all your goals in life with a starting salary of Rs.
    https://www.acte.in/amazon-web-services-training-in-chennai
    https://www.acte.in/AWS-training-in-bangalore
    https://www.acte.in/AWS-training-in-hyderabad
    https://www.acte.in/AWS-training-in-coimbatore
    https://www.acte.in/aws-certification-training

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

    ReplyDelete
  5. Python is used by Wikipedia, Google (where Van Rossum used to work), Yahoo!, CERN and NASA, among many other organisations. It's often used as a “scripting language” for web applications. This means that it can automate specific series of tasks, making it more efficient.keep continue with us,..

    python training in chennai

    python course in chennai

    python online training in chennai

    python training in bangalore

    python training in hyderabad

    python online training

    python training

    python flask training

    python flask online training

    python training in coimbatore

    ReplyDelete
  6. Cloud computing is one of the hottest technologies with a high demand for qualified professionals. The median salary for IT pros currently in a cloud computing career in the U.S. is $124,300. However, it is not the easiest of jobs to acquire because it is a specialty area.keep connect with us.it will help u lot guys..thanks you so much..
    AWS training in Chennai

    AWS Online Training in Chennai

    AWS training in Bangalore

    AWS training in Hyderabad

    AWS training in Coimbatore

    AWS training

    ReplyDelete
  7. Hey, great blog, but I don’t understand how to add your site in my reader. Can you Help me please?
    see this page

    ReplyDelete
  8. BookMyEssay is the best online Marketing Coursework Writing Help provider in the market. The company have the expert writers that help the students to score better grades.

    ReplyDelete
  9. Technique to Connect HP Deskjet 2622 Printer to Wi-Fi

    To introduce an network connection on your hp deskjet 2622 wifi setup , switch on your switch and set up a web association with broadband similarity. A broadband web association helps HP Printers in downloading and refreshing programming, printer drivers, and firmware for using web administrations. Subsequent to introducing this high velocity Internet availability, secure your network with a secret word alongside an network name. This is a best approach for HP Deskjet 2622 Wireless Setup.

    In the event that your HP Deskjet 2622 printer doesn't get associated with a wireless network, you need to check if the switch network is turned on that is high velocity empowered. On the off chance that your HP Deskjet 2622printer doesn't some way or another associate with the wireless network, go to the printer network settings and get your printer into an setup mode. Subsequent to remedying the network settings, presently connect your printer to Wi-Fi for hp Deskjet 2622 Wireless Setup.

    Press the Cancel button multiple times to reset the network settings. Then, at that point hold the Wireless symbol for 3 to 4 seconds to initiate WPS mode on your printer. This makes the printer start the clock for two minutes. Hold the WPS button in the switch board to match your switch and printer for HP Deskjet 2622 Wireless Setup. also check: How to Download USB Driver

    ReplyDelete
  10. Say you'll remember me standing in a nice dress denver doula

    ReplyDelete