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"

9 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. Among other courses, business research writing services has become popular since students seek Business Coursework Writing Services and business essay writing services.

    ReplyDelete
  8. It is important for business management assignment help seekers to find the best Business Management Writing Services from a reputable business management paper writing service provider for their custom business management essay services.

    ReplyDelete