how to insert Hindi language in MySQL,now ???? is coming in DB

We have to add different languages like Hindi,Marathi, Tamil etc inside text filed as per the required. Normally if you insert Hindi it will come ?????????? instead of characters in DB.To avoid this situation we have to set the DB to utf8 COLLATE utf8_unicode_ci.It support other character set also.Here am going to explain how to set it ,to insert Hindi language in MySQL we have to do below action

ALTER DATABASE CHARACTER SET utf8 COLLATE utf8_unicode_ci;

How to insert Hindi in MySQL database using PHP, now am getting question mark

Run below SQL query to check default character set

SHOW VARIABLES LIKE ‘character\_set\_%’;

Variable_name             Value
character_set_client      utf8mb4
character_set_connection  utf8mb4
character_set_database    latin1
character_set_filesystem  binary
character_set_results     utf8mb4
character_set_server      latin1
character_set_system      utf8

here the character_set_database value is latin2 To insert Hindi in MySQL database using PHP, we need to update character_set_database value to utf8 ,ALTER DATABASE and change the DB character and set it to utf8 COLLATE utf8_bin

ALTER DATABASE DB_NAME CHARACTER SET utf8 COLLATE utf8_bin