mysql設置數據庫的默認編碼
在安裝mysql的時候如果沒有選擇編碼方式的話,那麼系統將默認選擇latin1編碼,在mysql的控制台的窗口中輸入show variables like 'char%'可以查看到數據庫系統的默認的編碼集,如下:
vcq9o6xMYXRpbjHKx0lTTy04ODU5LTG1xLHww/ujrNPQ0Km7t76zz8LQtNf3TGF0aW4tMaGjSVNPLTg4NTktMbHgwuvKx7Wl19a92rHgwuujrM/yz8K85sjdQVNDSUmho7K71qez1tbQzsSx4MLro6zI57n7xOPU2rS0vajK/b7dv+K78r2ose3KscO709DD98i31ri2qLHgwuu1xLe9yr2jrMTHw7TK/b7dv+K9q7LJ08PErMjPtcSx4MLrt73KvaOstvi688Tj1Nqy5cjr1tDOxLXEyv2+3cqxvau74bP2z9bC0sLroaO1q8rHyOe5+87Sw8fDv7TOvajBosr9vt2/4rvyvPyx7cqxtrzSqsrWtq+1xNa4tqix4MLrt73KvbvhvvW1w7fHs6O1xMLpt7OjrMTHw7TO0sPHyOe6zrXEyta2r7XE0N64xMr9vt2/4rXExKzIz7XEseDC67e9yr3E2KO/PGJyPgo8YnI+CjEuudix1W15c3Fst/7O8aOs1Nq3/s7x1tDK1ravtcTNo9a5bXlzcWy3/s7xo6y78tXf1NpjbWS0sL/a1tDK5MjrbmV0ICBzdG9wIG15c3FsLjxicj4KPGJyPgoyLsi7uvO1vcTjtcRteXNxbLCy17C1xMS/wrzPwtXStb1teS5pbmnOxLz+o6zI57n7ysfOqrP1yry7r7XEyv2+3b/io6zEx8O0sNFteS1kZWZhdWx0LmNvZrjEzqpteS5jb2YsyLu689XStb3OxLz+1tBbbXlzcWxdLNTaxuS1xM/C0rvQ0NbQzO2808/Cw+bBvdDQPGJyPgpjaGFyYWN0ZXJfc2V0X3NlcnZlcj1nYmsgIDxicj4KaW5pdF9jb25uZWN0PQ=="SET NAMES gbk'
或者直接在my.ini中直接添加也行。
如下:
3.保存,然後重新啟動,再次查看,我們可以看見系統默認的編碼已經改變了。