-
Input address in a browser which: dev.mysql.com/downloads/mysql/ , as shown below:
-
The following screen, click on lower position, skipping selection log, after which point directly over the download, as shown below:
-
After the download is complete, double-click to open, the pop-up screen, and then clicking to continue, as shown below: 2
-
The following point has been continued until the installation is complete.
-
MySQL start, after installation, setting them to view the following options, if there are instructions MySQL has been successfully installed, as shown below:
-
When clicked, start MySQL, as shown below:
-
Modify the database password
After the startup is complete, open a terminal
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
The above two copy operation instruction to, the terminal, to the two addresses to a temporary alias
The next objective is performed may be performed directly or mysqladmin mysql
Not need to go back and forth switch directories, as shown below:
-
Next, modify the database password, execute the following command
mysqladmin -u root -p password root123
root123 is my new password, the password you want to amend its own set of
Press Enter, prompted for a password, the password entered is not time to let your computer password, but the password database.
Before there were 5.7 default user name and password are root
But after 5.7, only the default user name P: root
The default password is automatically assigned to you, it will be automatically assigned to you at the time of installation.
-
We can also come and view them from mac notification bar, below which is the automatic generation of a database password, as shown below:
-
The default password is localhost: All contents of the back, put it after the input, the carriage return. (Mac password on the command line which is invisible, so enter the password when careful not to input errors), as shown below:
-
Access to the database, see the above information, modify success
Next, enter the database among
确保执行了:alias mysql=/usr/local/mysql/bin/mysql
如果没有执行, 要自行切换到上面的目录当中,才能执行mysql命令
否则提示找到不mysql
接下来执行以下指令:mysql -u root -p
注意-p后面什么都不写,然后回车
会让你输入密码, 此时的密码就是你在上面修改的密码
我在这里输入的是:root123
看到如下信息,全部说明已经进入数据库当中,如下图所示:
-
在浏览器当中输入地址:dev.mysql.com/downloads/mysql/,如下图所示:
-
进入以下界面,直接点击下面位置 ,选择跳过登录,点过这后直接下载,如下图所示:
-
下载完成后, 直接双击打开,弹出以下界面,再继续点击即可,如下图所示:2
-
下面一直点继续直至安装完成。
-
启动MySQL,安装完毕后,到设置当中查看以下选项,如果里面有MySQL说明已经安装成功,如下图所示:
-
点击后, 启动MySQL ,如下图所示:
-
修改数据库密码
启动完成后,打开终端
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
把上面两条指令复制到终端当中运行,给两个地址给一个临时别名
目的是下一次执行可以直接执行mysql或者mysqladmin
不需要再去来回切换目录 ,如下图所示:
-
接下来修改数据库密码,执行以下命令
mysqladmin -u root -p password root123
root123是我的新密码,自行修改成自己想要设置的密码
按回车后, 提示输入密码,此时让输入的密码不是你电脑的密码,而是数据库的密码。
在5.7之前都是有默认用户名和密码的,都为root
但是从5.7之后, 只有默认的用户名P:root
默认的密码会自动给你分配,在安装的时候就会给你自动分配。
-
We can also come and view them from mac notification bar, below which is the automatic generation of a database password, as shown below:
-
The default password is localhost: All contents of the back, put it after the input, the carriage return. (Mac password on the command line which is invisible, so enter the password when careful not to input errors), as shown below:
-
Access to the database, see the above information, modify success
Next, enter the database among
Ensure the implementation of the: alias mysql = / usr / local / mysql / bin / mysql
If you do not perform to their own switch to the directory above them, in order to execute the command mysql
Otherwise, find tips not mysql
Then execute the following command: mysql -u root -p
Note -p nothing to write back, then Enter
Will let you enter the password, then the password is your password to modify the above
I enter here is: root123
See the following information, which has entered a full description of the database, as shown below: