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@127.0.0.1:abills
Error: rlm_sql_mysql: MySQL error: Host '127.0.0.1' 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@127.0.0.1 was specified in the FreeRadius configuration, then you can either change it to abills@localhost, or create a similar user:

CREATE USER 'abills'@'127.0.0.1' IDENTIFIED BY 'ixnfo.com';
GRANT ALL PRIVILEGES ON abills.* TO 'abills'@'127.0.0.1';

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