1. Implementation:
$ brew Install MySQL
2. /usr/local/etc/ under Create or modify mysql.conf, example:
[Client]port = 3306socket =/tmp/mysql.sockdefault-character-set = Utf8[mysqld]collation-server = Utf8_unicode_ Cicharacter-set-server = Utf8init-connect = ' Set NAMES UTF8 ' max_allowed_packet = 64mbind-address = 127.0.0.1port = 3306soc Ket =/tmp/mysql.sockinnodb_file_per_table=1[mysqld_safe]timezone = ' +0:00 '
3. Like after the installation of MySQL, he will prompt you to init database, and provide the following two sentences let you execute, it is possible that you did not execute these two sentences
$ unset tmpdir$ mysql_install_db--verbose--user= ' WhoAmI '--basedir= "$ (brew--prefix MySQL)"--datadir=/usr/local/var/ MySQL--tmpdir=/tmp
4. Then you can point mysql.server start to start, for security, you can also execute the Security Settings Wizard, follow the prompts step by step configuration
$ mysql_secure_installation
MySQL for Mac installation