FreeRadius. error solution rlm_sql_mysql: Couldn’t connect to MySQL server

Once I installed FreeRadius 3.0.23, by the way I described the process in the article: ABillS. Installing Freeradius, and optimized some parameters of the MySQL server, after which FreeRadius stopped starting and I saw errors in the logs:

Error: rlm_sql_mysql: Couldn't connect to MySQL server abills@
Error: rlm_sql_mysql: MySQL error: Host '' is not allowed to connect to this MySQL server
Error: rlm_sql (sql): Opening connection failed (0)
Error: /usr/local/freeradius/etc/raddb/mods-enabled/sql[1]: Instantiation failed for module "sql"

The error occurred due to the fact that I added the skip-name-resolve parameter to the MySQL server configuration.

So I created the user abills@localhost, and abills@ was specified in the FreeRadius configuration, then you can either change it to abills@localhost, or create a similar user:

GRANT ALL PRIVILEGES ON abills.* TO 'abills'@'';

After this, there should be no error and you can start FreeRadius using the restart command:

service radiusd restart
service radiusd status

When I ran the service radiusd start command, the error was repeated, and after service radiusd restart it started successfully.

Leave a comment

Leave a Reply