1, installation and configuration database MYSQL

installation


1. Open the official website https://www.mysql.com , select the community version


 

2, as shown in the next click install (I personally feel very long time to download, need to wait, do not know why there will be speed limits, refer to the online tutorial download Thunder, I am with official website to download directly slightly during the download process and so on will be just fine, white feeling download is the stage)


3, installation,


1, no brain type next

2, note that port, if the exclamation mark is displayed next can not be the solution as follows:

Solution:



As shown above: when Mysql during installation, to be part of this type and Networking, the gray can not be displayed next click (a click input the password normally occur next), the warning triangle is displayed next to the port, means 3306 port is occupied;

Solving steps:


1, Win + R netstat -aon open command input command interface, query port is occupied, the above figure is found 3306 2676 occupied PID of the program;

2. Right-click on the windows task bar - Task Manager - users find the 2676 program to select End Task PID;

3, after the Mysql installation interface (type and Networking) Click Back Click next again will find the next button already can click slightly, to continue installing it;

【summary】:

Order to solve the port occupancy:

1, the query port appropriations: netstat -aon


 

2. Check the specified port occupancy (3306 is the port number): netstat -aon | findstr 3306


 

3, see the program of the indicated PID (11660 is the PID number): tasklist | findstr11660


 

4, the end of the process: taskkill / f / t / im mysqld.exe


carry on……

Future tutorials will only relate to the password settings, and then others would like direct default, the installation process for the first time in my experience it only above a relatively downright problem, if you encounter other problems at the time of installation, welcome leave a message


Configuration environment variable

Dos command to connect with the database, change, add database operations


完成后安装好MySQL,为MySQL配置环境变量。

0)在我的电脑上点击右键选择属性--》高级系统设置--》环境变量

1)新建MYSQL_HOME用户变量,并配置:D:\Develop\mysql\mysql-8.0.12(你的文件解压的地方)

MYSQL_HOME:D:\Develop\mysql\mysql-8.0.12

2)编辑path系统变量,将%MYSQL_HOME%\bin添加到path变量后。配置path环境变量,也可不新建MYSQL_HOME变量,而是直接将MySQL安装目录下的bin配置到path变量下,即:D:\Develop\mysql\mysql-8.0.12bin

Path:%MYSQL_HOME%\bin

或Path:D:\Develop\mysql\mysql-8.0.12\bin(我的就是直接添加的,因为像上述操作,在path中添加用户变量名之后,不会起任何作用,所以就直接在path中添加的路径)

3)注意:有的朋友可能会遇到配置完MYSQL_HOME变量后,好像不起什么作用,这时候你在系统变量新建MYSQL_HOME试试!

4)win+R直接进入cmd,输入第一个命令:mysql -uroot -p,验证是不是可以输入密码连接数据库了

 

Guess you like

Origin www.cnblogs.com/guo-2020/p/12306723.html