Support » Fixing WordPress » WordPress Database or Network Repair and Fix

  • Pufak

    (@pufak)


    Dear Sir/Madam
    i don’t have any problem its just a random question about the database when i open the config.php file i find that there’s some line looks like that.

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8mb4');

    and when I remember install WordPress with utf8_general_ci DB_CHARSET

    so i go to PhpMyAdmin in the server check the tables and it looks like that with alone tables

    wp_users	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	~3	InnoDB	utf8mb4_unicode_ci	48 KiB	-
    	wp_wfBadLeechers	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	~0	InnoDB	latin1_swedish_ci	16 KiB	-
    	wp_wfBlockedIPLog	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	~0	InnoDB	utf8_general_ci	16 KiB	-
    	wp_wfBlocks	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	~0	InnoDB	utf8_general_ci	32 KiB	-
    	wp_wfBlocksAdv	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	~0	InnoDB	utf8_general_ci	16 KiB	-
    	wp_wfConfig	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	~116	InnoDB	utf8_general_ci	5.5 MiB

    so as you can see some of DB_CHARSET different than others
    latin1_swedish_ci and utf8_general_ci and utf8mb4_unicode_ci

    is that ok? or make my web in a bad problem? do i have to fix it or that is ok ?

    sometime i feel the web going slow and network error with some database error too i don’t want that happens when the web get load of visitors

    so don’t know what really good to do and help my web to be more stable with no errors ?

    thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Max

    (@clementsm)

    You probably want to make sure you use the same collation and char-set for every table.

    I would recommend you change the line in your wp-config.php to:

    define ( 'DB_CHARSET', 'utf8');

    and add a collation:

    define ( 'DB_COLLATE', 'utf8_unicode_ci');

    Then once you have done this, set the default character-set and collation for your database using the following SQL Query:

    ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    You should replace the word databasename with your actual database name.

    Then after you have done that – you will need to change the collation and character-set on every table in the database to match. This will convert the tables to use the same character-set and collation:

    ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    Again, change tablename to the name of every table that you wish to change.

    Needless to say, you need to make a backup before you do any of this to your database.

    At this point everything in your database should be converted to UTF8 as well, and things should start to be interpreted correctly.

    Pufak

    (@pufak)

    Thank you Max

    Pufak

    (@pufak)

    when try to convert table

    #1366 – Incorrect string value: ‘\xF0\x9F\x91\x8D\xF0\x9F…’ for column ‘meta_value’ at row 10792

    Pufak

    (@pufak)

    @max there’s other error too

    #1366 – Incorrect string value: ‘\xF0\x9F\x91\x8D\xF0\x9F…’ for column ‘post_content’ at row 1770

    two tables can’t be converted

    Pufak

    (@pufak)

    This two tables can’t be converted

    #1366 – Incorrect string value: ‘\xF0\x9F\x91\x8D\xF0\x9F…’ for column ‘meta_value’ at row 10792

    #1366 – Incorrect string value: ‘\xF0\x9F\x91\x8D\xF0\x9F…’ for column ‘post_content’ at row 1770

    any one can help would be good ?!

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress Database or Network Repair and Fix’ is closed to new replies.