I installed the following two blog posts, but there are some differences, here to write a good reference source:
http://blog.csdn.net/li_huifeng/article/details/9449685
Http://www.jianshu.com/p/fd3aae701db9
First, installation
Official website Download: http://dev.mysql.com/downloads/mysql/
Second, click, install the Package
Third, the installation will give you the root user an initial password
Iv. Enter System Preferences
Five, start
VI. Open terminal, define MySQL alias
Enter the alias command
Alias Mysql=/usr/local/mysql/bin/mysql
Return, enter again
Alias Mysqladmin=/usr/local/mysql/bin/mysqladmin
Configuring Environment variables
export Path=/usr/local/mysql/bin: $PATH
Vii. also need to add MySQL to the system environment variable
(1)/usr/local/mysql/bin,查看此目录下是否有mysql
Input: cd/usr/local/mysql/bin/
< Span style= "font-size:16px" > ( 2). Execute vim ~/.bash_profile ,
add the Mysql/bin directory to the file ( Path= $PATH: /usr/local /mysql/bin
) as
添加完成后,按esc,然后输入wq保存。最后在命令行输入 source ~/.bash_profile
Eight, Login
Now you can login MySQL through mysql-uroot-p, will let you enter the password, is the above to remember the initial password (q+p:)-u5vtnt)
After the login is successful, you can change the password by following the command
SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘newpass‘);
SQL---->mysql Install for Mac