mysql故障排查——20200701

1. 由于找不到vcruntime140.dll,无法继续执行代码 mysql。重新安装程序可能会解决此问题

安装mysql出现问题:由于找不到VCRUNTIME140_1.dll,无法继续执行代码。重新安装程序可能会解决此问题
排错日志——Mysql

2. 安装成功后,闪退

之前mysql用着好着,可是今天在启动mysql后输入密码出现了闪退,在任务管理器中发现mysql服务没有启动,当手动启动时提示拒绝访问。在网上查找原因发现问题所在。

问题原因:mysql服务没有安装。
https://www.jb51.net/article/90938.htm

解决办法
D:\web\mysql-8.0.19\mysql-8.0.19-winx64\bin>mysqld --initialize --console

3. 提示:发生系统错误 5。 拒绝访问。

原因:没有以管理员权限运行cmd.exe程序
完成之后,之前设置的用户名丢失了。

4. 查看用户名

select host,user,authentication_string from mysql.user;
密码是用md5加密过的,只能看到加密后的内容,无法找回密码。
排错日志——Mysql
mysql新建用户,修改权限

(1)登录:mysql -u root -p

(2)查看现有用户(mysql8.0.1)
(3)新建用户

格式:create user “username”@“host” identified by “password”;

eg:

1.mysql->create user ‘test’@‘localhost’ identified by ‘123’;

2.mysql->create user ‘test’@‘192.168.7.22’ identified by ‘123’;

3.mysql->create user ‘test’@’%’ identified by ‘123’;
/host=“localhost"为本地登录用户,host=“ip"为ip地址登录,host=”%”,为外网ip登录/

(4)删除用户

格式:drop user ‘username’@‘host’;

(5)授权

格式:grant privileges on databasename.tablename to ‘username’@‘host’
IDENTIFIED BY ‘PASSWORD’;

新建用户后重新连接:

5. 时区问题

url: jdbc:mysql://localhost:3306/test?serverTimezone=Asia/Shanghai

参考解决MySQL8.0时区的问题

相关文章:

  • 2021-10-16
  • 2022-12-23
  • 2021-08-22
  • 2022-02-08
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-30
  • 2021-08-14
  • 2022-12-23
  • 2021-06-17
  • 2021-09-14
  • 2021-06-19
  • 2022-12-23
相关资源
相似解决方案