打开网页http://www.bjelf.com/
网页显示连接mysql库失败,请确定数据库用户名,密码设置正确
Can't connect to MySQL server on 'bjelf.com' (10061)
2003
怎么解决
看你的意思,是别人的网站?那你处理不了。
如果是你自己的网站,那就确定一下数据库连接的账号密码对不对就好了呀。
就你这样,只能按字面意思解决呗
按他提示,怎么确定数据库用户名,密码设置正确
检查下后台数据库连接用户名密码是否正确
看看这2个解决方案吧,一样的错误
https://kalacloud.com/blog/can-t-connect-to-mysql-server-on-ipaddress-10061/
https://www.jb51.net/article/26505.htm
数据库连接的用户名或密码不对,怎么确定?数据库用户名、密码都不知道吗,先用数据库客户端连接测试一下。
是不是mysql服务没启动
是你自己的网站吗?如果是是自己的网站就按照报错处理。
有如下3个原因:
1、数据库连接地址出错
2,数据库用户名和密码错误
3,mysql服务器没有启用
数据库没连接上,你的连接参数不对
你这个网页链接没有任何让输入用户名密码的地方,建议你先用数据库客户端连接试试
你用户名密码的问题。 现在线下测试一下,在使用网页。
首先你得检查你的mysql是不是启动的,第二检查账号、密码是否正确,最后再检查代码中连接方式是否正确
[root@gree135 ~]# systemctl restart network.service
[root@gree135 ~]# yum install -y wget
[root@gree135 ~]# wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
[root@gree135 ~]# yum localinstall mysql57-community-release-el7-8.noarch.rpm
[root@gree135 ~]# yum install mysql-community-server
[root@gree135 ~]# systemctl start mysqld
[root@gree135 ~]# systemctl enable mysqld
[root@gree135 ~]# systemctl daemon-reload
[root@gree135 ~]# systemctl stop firewalld
[root@gree135 ~]# systemctl disable firewalld
[root@gree135 ~]# grep 'temporary password' /var/log/mysqld.log
2021-10-08T03:21:28.093080Z 1 [Note] A temporary password is generated for root@localhost: 2qdMM&vmgRTB
[root@gree135 ~]# mysql -uroot -p
Enter password:
#设置密码报错,密码不符合安全等级
mysql> alter user 'root'@'localhost' identified by 'root';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
#设置mysql密码安全等级
mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
#重新设置密码成功
mysql> alter user 'root'@'localhost' identified by 'root';
Query OK, 0 rows affected (0.00 sec)
#设置远程登陆
mysql> grant all privileges on . to 'root'@'%' identified by 'root' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
1.后端是用什么语言写的。