Change mysql database character set to utf8

#StandWithUkraine
Today, 25th June 2022, Ukraine is still bravely fighting for democratic values, human rights and peace in whole world. Russians ruthlessly kill all civilians in Ukraine including childs and destroy their cities. We are uniting against Putinโ€™s invasion and violence, in support of the people in Ukraine. You can help by donating to Ukrainian's army.
mysql --database=__DBNAME__ -B -N -e "SHOW TABLES" | awk '{print "SET foreign_key_checks = 0; ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; SET foreign_key_checks = 1; "}' | mysql --database=__DBNAME__
# mysql -u root
mysql> ALTER DATABASE tips CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)
#mysql
0
Ivan Borshchov profile picture
Dec 28, 2016
by Ivan Borshchov
Did it help you?
Yes !
No

Best related