MySQL安装报错、改密&设置IP连接

1.MySQL安装如出现计算机中丢失MSVCP140及VCRUNTIME140/VCRUNTIME140_1,则在Visual C++官方下载地址:https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads 下载安装即可(根据电脑选择64位或者32位)。安装后继续报错,则将下载 vcruntime140_1.dll 文件,解压后将vcruntime140_1.dll复制到C:\Windows\System32文件夹下即可(64位的是C:\Windows\SysWOW64目录下)


2.MYSQL时完成后会给出随机密码,如图所示的,如需修改密码,则在cmd命令行中定位到MYSQL的bin目录下,通过语句 mysqladmin -u用户名 -p旧密码 password 新密码来修改

 

3.设置MySql允许IP连接。CMD命令通过mysql -u root -h 127.0.0.1 -p登录到MySql(有密码的话继续输入密码并回车)。

   使用use mysql;切换到mysql数据库,注意不要省略;号

   输入命令update user set host = '%'  where user ='root';  将用户root的host修改为%即可实现IP登录

  使用命令  flush privileges;  进行刷新

  最后quit;  退出,就实现了通过IP来连接数据库

 

参考文献:http://c.biancheng.net/view/7152.html

                  https://blog.csdn.net/m0_61933976/article/details/125995999

                  https://blog.csdn.net/qq_37738899/article/details/127138607

                 https://blog.51cto.com/qubernet/5161058

posted @ 2023-03-06 15:18  真真真甜  阅读(117)  评论(0)    收藏  举报