Recently to the school to do a project, the database to use Oracle, if under Windows, the installation of Oracle is relatively simple, but unfortunately, I have recently switched to the Mac, so this is a big problem, Oracle now the latest version does not support Mac OS system, Currently 10g is supported for Mac OS, but the resources of 10g official website have been removed, but you can get the 10g Oracle installation package from Mac by other channels. It's a little far away, but it's back to our topic. Since I have not yet installed Oracle on my Mac system, I will use MySQL first in order not to slow down the progress of the project. But when I installed MySQL on the system, I just inserted a piece of data there is an error, below to show you:
Solutions to this problem:
Visualization tool: When you create a new database, remember to modify the default Collation to UTF8 to solve this problem.
If you're not using a visualizer, it's a little more complicated:
Command line form:
Open Terminal: Enter the following command,
Cd/usr/local/mysql/bin
VI msqld
In this file, add
Default-storage-engine=innodb
Character-set-server=utf8
collation-server=utf8_general_ci
Then enter (: qw!)
============= "It is said that the above method will lead to the inability to start MySQL, I have not encountered this situation, if you love the research problem, you can try it yourself, when you encounter problems is a very good way to learn, memory very deep. If you share it and discuss it with everyone, your level is a bit higher.
This should be OK, there are many ways to resolve the command line.
Because before the use of MySQL did not encounter this problem, but I see this problem when I was relatively calm, I probably see this error should be MySQL internal setup error, so I went to the Niang to ask, the answer is a lot, but all feel the answer is more complicated than the problem, I did not say their methods are not good, their methods are very technical content, like me, such as rookie is generally more ugly to understand. But through other people's answers I probably know is for God horse wrong, because the problem of Chinese strings, because the tool is someone else's foreigner developed, of course, the default will not set the string to Chinese format. So the future of China's software industry depends on you.
1366 errors encountered in MySQL solution