I would like to know how to set a character set once and permanently, since when i alter the character_set% variables
that are shown on 'show varables like 'character_set%', when i alter them the next day they are back with the old values?
The character set is a property of the server, the database, the table and the field - in that order. Each has a default which can be overwritten by the following. You can change it using the alter table syntax.
Then there is the client and the connection character set which define how the character set is translated on its way from the database to the end user. You can alter those by setting defaults in my.ini (or my.cnf) or by starting the mysql server with explicit values for those variables:
If you're in one of those predicaments where cls.__private attributes just aren't enough since they can easily be accessed through inst._cls__private, and you need something a little more secure, here's ...