method One: if installed homebrew can be installed directly through homebrew, there is a tutorial online.
Method Two:
I used method Two, downloaded the MySQL installation file DMG directly on the official website, then double-clicked,
1: Click on the first Pkg will pop up the installation steps, and then all the way next is OK. In the end, you will see tips for installation, and if there is a problem in the middle, open readme.txt for reading.
2: The role of the third Pkg is to set whether to start the MySQL boot, if after double-click follow the instructions next will be installed successfully. If you want to cancel the boot start MySQL, open readme.txt, which has instructions.
3: The role of the second file is to manually start MySQL.
4: After installation, you can view the relevant files: switch to root with the sudo-i command. The corresponding directory can be found by reading Readme.txt.
5: Execute MySQL command, will prompt command not found, need to map MySQL command to Usr/bin.
The command operation is as follows:
macbook-pro:/root# ln-s/usr/local/mysql/bin/mysql/usr/bin
Then execute MySQL and you will be prompted as follows:
Then the installation succeeds, and you can do the work of creating the library and the SQL command.
Mac install MySQL