[client]
default-character-set=utf8
This option can force client programs to use specific character set.
This is normally unnecessary. However, when character_set_system differs from character_set_server or character_set_client, and you input characters manually (as database object identifiers, column values, or both), these may be displayed incorrectly in output from the client or the output itself may be formatted incorrectly. In such cases, starting the mysql client with --default-character-set=system_character_set—that is, setting the client character set to match the system character set—should fix the problem.
[mysqld]
default-character-set = utf8
MySQL Server has a server character set and a server collation. These can be set at server startup on the command line or in an option file and changed at runtime.
The server character set and collation are used as default values if the database character set and collation are not specified in CREATE DATABASE statements. They have no other purpose.
Conclusion: Client setting is at session level whenever client connects to server, server forces clients to use specific charset however this is not necessary.
Mysqld section charset indicates that server is configured to use particular charset by default however you can change charset at any level Database
,Table
and Column
level you want.
Based on your default database encoding, character_set_database=latin1, you should force your client to use latin1. Your client is currently in utf8 and the database appears to be in latin1. This assumes that your table is also using latin1.
To make sure your data is stored correctly in MySQL, you can force the mysql client to use latin1.
1 Force the Client to use latin1
mysql -u root -p --default-character-set=latin1 nameofthedatabase
Then run your SELECT statement to verify the character formatting
select budgetID,StartDate,modifiedBy from Table_name order by budgetID desc limit 10
2 Backup the database using latin1
You can also dump the database using the same option
mysqldump -u root -p --default-character-set=latin1 nameofthedatabase > nameofthedatabase.sql
Then you could view the dump file nameofthedatabase.sql using a standard text editor like textpad or gedit to see if the characters are encoded correctly.
Collation is a set of rules that determine how rows are sorted and how they are compared. Collation does not affect the encoding which is the problem you are currently having.
If both options still give you weird symbols, the import file may not have been correctly formatted in the first place.
Best Answer
Here is the list of collations under UTF-8
latin1_swedish_ci
belongs to latin1The closest utf8 for your collation is ID 200
CAVEAT
You may have to experiment with latin1, change the character set and collation of the individual column in the table, or possibly both. At the very least, use latin1 for display in phpmyadmin.
You could tweek and experiment with making the entire database a specific character set and collation using ALTER DATABASE.
Make sure you make a backup of the database and load it into a dev/staging DB and then run ALTER DATABASE against dev/staging.