What Can I Do If My Database Login Fails?
Database Username or Password Errors
- If error message Access denied for user 'myuser'@'100.xxx.xx.xx' (using password: YES) is displayed, the possible causes and solutions are as follows:
(1) Error cause: The MySQL database username or password is incorrect.
Solution:
Check whether the database username and password are correct. If they are correct, log in to the database using the client or CLI tool and run the select * from mysql.user where user = 'myuser' command to view user information. If there are users using 100.x.x.x IP addresses, user myuser@100.x.x.x is used for login. This is because myuser@x.x.x.x and myuser@100.x.x.x are different usernames, their passwords and permissions are independent of each other, and DAS can connect to databases via users with 100.x.x.x IP addresses only. Therefore, check whether the input password belongs to user myuser@100.x.x.x.
(2) Error cause: The IP address of the DAS server is not in the whitelist of the login user.
Solution:
Log in to the database using a client or CLI tool, and create a database user that DAS can connect to.
create user 'das'@'100.%' identified by 'password'; grant all privileges on *.* to 'das'@'100.%';
- If error message Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server xxx.xxx.xx.xx:8635. The full response is { "ok" : 0.0, "errmsg" : "Authentication failed.", "code" : 18, "codeName" : "AuthenticationFailed" is displayed, the possible cause and solution are as follows:
Error cause: The DDS username or password is incorrect, or the input username and database do not match.
Solution:
Check whether the username and password are correct. Then check whether input username belongs to the database you want to log in to.
- If error message Login failed for user 'xxx'. ClientConnectionId:xxx is displayed, the possible cause and solution are as follows:
Error cause: The Microsoft SQL Server database username or password is incorrect.
Solution:
Check whether the database username and password are correct.
- If error message Connection refused (Connection refused) is displayed, the possible cause and solution are as follows:
Error cause: The PostgreSQL database username or password is incorrect.
Solution:
Check whether the database username and password are correct.
- If error message Host 'xxx.xxx.xx.xx' is not allowed to connect to this MySQL server. is displayed, the possible cause and solution are as follows:
Error cause: The entered database user is not allowed to remotely log in to MySQL databases.
Solution:
Log in to the MySQL database locally using a client or CLI tool, and create a user with the remote login permission.
create user 'das'@'%' identified by 'password'; grant all privileges on *.* to 'xxx'@'%';
Alternatively, specify only the IP address of the DAS server to log in to the database.
create user 'das'@'100.%' identified by 'password'; grant all privileges on *.* to 'xxx'@'100.%';
Network Errors
- If error message Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server is displayed, the possible causes and solutions are as follows:
(1) Error cause: Access to this port is not allowed by the ECS security group.
Solution:
Click the ECS security group and check whether the self-built database port is included in the inbound rules.
If not, add an inbound rule that allows access to the port of the self-built database. You may set the source IP address to 0.0.0.0/0 or the DAS server IP address 100.0.0.0/8.
(2) Error cause: Access to this port is not allowed by the ECS firewall policies.
Solution:
Remotely log in to the ECS and run the iptables -S command to view the iptables configuration. If the self-built database port is not included in the firewall whitelist, add an iptables rule or run the systemctl stop iptables command to disable the firewall to allow the access to this port.
- If error message The TCP/IP connection to the host 100.xxx.xx.xx, port xxx has failed. is displayed, the possible cause and solution are as follows:
Error cause: The input port number of the SQL Server self-built database is incorrect.
Solution:
Check whether the input port number of the self-built database is correct and whether the port is included in the security group rule and firewall whitelist.
Permission Issues
- If error message Sorry, you do not have the permission to access DAS. is displayed, the possible cause and solution are as follows:
Error cause: Your HUAWEI CLOUD account does not have the DAS Administrator permission.
Solution:
Grant the DAS Administrator permission by referring to Creating a User and Granting Permissions.
- If error message This operation is not allowed because the login account only has the read-only permission. Grant the DAS Administrator permission. is displayed, the possible cause and solution are as follows:
Error cause: Your HUAWEI CLOUD account does not have the DAS Administrator permission.
Solution:
Grant the DAS Administrator permission by referring to Creating a User and Granting Permissions.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.