Bootstrap FreeKB - mySQL / MariaDB - Resolve "Aborted connection to db unconnected"
mySQL / MariaDB - Resolve "Aborted connection to db unconnected"

Updated:   |  mySQL / MariaDB articles

Let's say your mySQL or MariaDB error log contains the following warning.

Aborted connection 209541 to db: 'unconnected' user: 'john.doe' host: 'server1.example.com' (Got an error reading communication packets)

 

Notice in this example that the connection was aborted for user john.doe. If you have root access to mySQL or MariaDB, check John Doe's grants. Notice in this example that % is used. Since the error references a hostname (server1.example.com), the % character is used because % represents remote connection (not localhost).

~]# mysql -e "show grants for 'john.doe'@'%'"
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for john.doe@%                                                                                                                                        |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `john.doe`@`%` IDENTIFIED BY PASSWORD '*B87A204DF7CFB2D10258BBA8AC00DC081CD35EF2' |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+

 

Let's say you determine that John Doe needs to be granted access to replication slave. You can use the grant statement to grant John Doe access.

mysql -e "grant replication slave on *.* to 'john.doe'@'%'"

 

Reissuing the show grants statement, you should now see John Does updated grants.

~]# mysql -e "show grants for 'john.doe'@'%'"
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for john.doe@%                                                                                                                                        |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT REPLICATION SLAVE, REPLICATION MASTER ADMIN, SLAVE MONITOR ON *.* TO `john.doe`@`%` IDENTIFIED BY PASSWORD '*B87A204DF7CFB2D10258BBA8AC00DC081CD35EF2' |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 27762d in the box below so that we can be sure you are a human.