Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,220
    Thanks
    378
    Thanked 60 Times in 58 Posts

    Converting from utf8 to utf8mb4

    I just started a project and have been convinced that its prob a really good idea to convert now ahead of having to do it later.

    So i dont have that much data per say in the tables, but i have alot of tables i think last count was 27. I have heard that phpMyAdmin is not 100% conversion perfect and even MySql is saying there really is no perfect way to convert, conversion is not a perfect world.

    So my options are:

    1. zap all the tables and recreate them all again from scratch using utf8mb4
    2. since im not using chinese characters, emojis, or obsure alphabets, or long text. I could take my chances at letting phpMyadmin convert it for me.
    3. stick with utf8 and forget about utf8mb4 for this project.
    4. remove all data from db then convert then recreate the data - which would be easier since i dont have that much in there now.
    5. do something else that i am not aware of yet.


    Advice....

    Thanks

    PS what happened to this mysql form, it looks like its been cleaned out, only a few posts in here, whats up with that ?
    Last edited by durangod; Jun 16th, 2019 at 05:22 AM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  2. #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    North Carolina
    Posts
    1,561
    Thanks
    5
    Thanked 250 Times in 247 Posts
    I believe the fora are automatically trimmed of older posts and this one doesn't get much activity at all any more so there's almost nothing here most of the time any more.

    For your databases and tables use utf8mb4_unicode_520_ci for the collation. There's at least one level of unicode higher out there but it hasn't made its way to MySQL/MariaDB yet. What you have to watch out for are text columns that are very "full". If you have a column that is defined as varchar(8) and the data is 8 characters changing it to utf8mb4 MAY result in truncation.

    There's a lot to making a PHP application "UTF8 all the way through" and this question and answer on Stackoverflow should help.
    Dave .... HostMonster for all of your hosting needs

  3. Users who have thanked djm0219 for this post:

    durangod (Jun 16th, 2019)

  4. #3
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,220
    Thanks
    378
    Thanked 60 Times in 58 Posts
    Thank you sir, basically i just have some config settings, product info, and vendor data so i can zap that no problem and convert the DB. Thanks for the heads up...
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •