Home > Database > Mysql Tutorial > body text

OSX下完全删除MySQL和怎样使MySQL支持中文

WBOY
Release: 2016-06-07 16:18:30
Original
925 people have browsed it

可以在我的新页面看到这篇文章 最近在OSX下装了个最新版的MySQL,研究了一下,比如以前经常出现的中文乱码问题和完全卸载问题也遇到了,于是趁着今天闲着没事情干就把这些都谢谢,以后要用了查起来也方便,虽然我也已经放到我的Evernote里面了。 完全卸载MyS

 可以在我的新页面看到这篇文章

最近在OSX下装了个最新版的MySQL,研究了一下,比如以前经常出现的中文乱码问题和完全卸载问题也遇到了,于是趁着今天闲着没事情干就把这些都谢谢,,以后要用了查起来也方便,虽然我也已经放到我的Evernote里面了。

完全卸载MySQL For OSX

先停止所有MySQL有关进程:

1

2

3

4

5

6

7

8

9

sudo rm /usr/local/mysql

sudo rm -rf /usr/local/mysql*

sudo rm -rf /Library/StartupItems/MySQLCOM

sudo rm -rf /Library/PreferencePanes/My*

vim /etc/hostconfig and removed the line MYSQLCOM=-YES-

rm -rf ~/Library/PreferencePanes/My*

sudo rm -rf /Library/Receipts/mysql*

sudo rm -rf /Library/Receipts/MySQL*

sudo rm -rf /var/db/receipts/com.mysql.*


Over.

设置中文支持

配制方法如下:
1. 拷贝/usr/local/mysql/support-files下的任意一个*.cnf文件到/etc/my.cnf

  • 在my.cnf文件的[client]后面添加一句default-character-set=utf8

  • 在[mysqld]后面添加如下三句:

    1

    2

    3

    default-storage-engine=INNODB

    character-set-server=utf8

    collation-server=utf8_general_ci

  • 保存退出,reboot MySQL就可以了
    以上。

  • Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!