首页 > 编程知识 正文

连接数据库的步骤,连接不上数据库有哪些问题

时间:2023-05-03 06:58:49 阅读:110261 作者:4906

在意外情况下突然无法连接到linux上的mysql

在Linux上登录MySQL数据:mysql -uroot -p输入密码切换到MySQL数据库mysqluse mysql输入grantallprivilegeson *.* to root @ ' % '。 mysqlgrantallprivilegeson *.* to root @ ' % ' identified by ' * * * '; 这意味着本地ip拥有包括远程访问在内的所有权限,而%百分比符号意味着任何ip都可以访问数据库。 然后输入mysql flush privileges; 重新加载并退出mysqlexit后,可以使用service和systemctl命令重新启动数据库service mysql restart注:服务。 我不知道是Linux的版本不同,还是命令因服务而异,但是请同时关闭防火墙。 将service iptables stop或systemctl stop firewalld.service连接错误useSSL=true更改为useSSL=false

//use unicode=truecbdfn=utf8 use SSL=truestringurl=' JDBC : MySQL 3360//192.168.154.13033603303306/JDBC stusty

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。