New custom query - MySQL
Rodrigo Prazim
rodrigoprazim at hotmail.com
Sat Jul 12 13:58:10 UTC 2025
Hi, Matthew.
Correction:
In radiusd -X
The console displayed the query error:
(0) Executing select query: "INSERT INTO radius.radcircuitid (username, circuitid) VALUES ('teste at allohaligue', 'HelloWorld') ON DUPLICATE KEY UPDATE circuitid = 'HelloWorld'"
(0) ERROR: rlm_sql_mysql: ERROR 1064 (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"INSERT INTO radius.radcircuitid (username, circuitid) VALUES ('teste at allohaligu' at line 1): 42000
(0) ERROR: SQL query failed: server error
Then I made the correction to:
"%{sql:INSERT INTO...}"
And no erro appeared:
(0) Executing query: INSERT INTO radcircuitid (username, circuitid) VALUES ('teste at allohaligue', 'OlaMundo112') ON DUPLICATE KEY UPDATE circuitid = 'HelloWorld'
rlm_sql (sql): Released connection (6)
Even though it worked, I would like to know if it is the best way out.
...
Rodrigo Prazim
________________________________
De: Freeradius-Users <freeradius-users-bounces+rodrigoprazim=hotmail.com at lists.freeradius.org> em nome de Matthew Newton via Freeradius-Users <freeradius-users at lists.freeradius.org>
Enviadas: Sábado, 12 de Julho de 2025 10:43
Para: freeradius-users at lists.freeradius.org <freeradius-users at lists.freeradius.org>
Cc: Matthew Newton <mcn at freeradius.org>
Assunto: Re: New custom query - MySQL
On 12/07/2025 14:41, Rodrigo Prazim wrote:
> I'm using the radclient for test:
> echo "User-Name='teste at allohaligue',User-Password=testeligue,ADSL-Agent-Circuit-Id=HelloWorld" | radclient localhost:1812 auth testing123
> But nothing arrives in the database:
I guess nothing arrives in the FreeRADIUS debug output, either.
--
Matthew
-
List info/subscribe/unsubscribe? See https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.freeradius.org%2Flist%2Fusers.html&data=05%7C02%7C%7C7efbe347a26c484954b308ddc14a2f6a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638879246557523792%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=eIXX8dxg83zZKjwlBATgzJs4EhMnUgvsbndxQeDi2ac%3D&reserved=0<http://www.freeradius.org/list/users.html>
More information about the Freeradius-Users
mailing list