Server IP changed and "FreeRADIUS+MySQL" does not work
I have installed FreeRADIUS and MySQL on the same machine. "FreeRADIUS + MySQL" had worked well before Server IP changed. For some reason the server had to be carried to a new place and its IP must be changed. After the server IP changed, "FreeRADIUS + MySQL" does not work. I have edited sql.conf and changed IP to the new correct IP . I also edited the table "user" in the database "mysql" and altered the Host field from the old IP to the new correct IP. However these mendings do not work. The following is part of the result to the command "radiusd -X": rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked rlm_sql (sql): Attempting to connect to root@202.117.54.251:/radius rlm_sql (sql): starting 0 rlm_sql (sql): Attempting to connect rlm_sql_mysql #0 rlm_sql_mysql: Starting connect to MySQL server for #0 rlm_sql_mysql: Couldn't connect socket to MySQL server root@202.117.54.251:radius rlm_sql_mysql: Mysql error 'Access denied for user 'root'@'202.117.54.251' (using password: YES)' rlm_sql (sql): Failed to connect DB handle #0 rlm_sql (sql): starting 1 rlm_sql (sql): starting 2 rlm_sql (sql): starting 3 rlm_sql (sql): starting 4 rlm_sql (sql): Failed to connect to any SQL server. Module: Instantiated sql (sql) I have not compile and install FreeRADIUS and just edited the related files. What should I do to make FreeRADIUS and MySQL work well again ? Thanks in advance. Regards Guoxian
Hi,
rlm_sql_mysql: Couldn't connect socket to MySQL server root@202.117.54.251:radius rlm_sql_mysql: Mysql error 'Access denied for user 'root'@'202.117.54.251' (using password: YES)' rlm_sql (sql): Failed to connect DB handle #0
Well, that gives a strong hint, doesn't it? Your MySQL server is configured to allow user "root" only from certain IPs. The one IP you changed to is not allowed to connect to the MySQL server. The solution is to configure MySQL so that you can access the database... Stefan -- Stefan WINTER Stiftung RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche Ingenieur Forschung & Entwicklung 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg E-Mail: stefan.winter@restena.lu Tel.: +352 424409-1 http://www.restena.lu Fax: +352 422473
yao guoxian wrote: ...
rlm_sql_mysql: Couldn't connect socket to MySQL server root@202.117.54.251:radius rlm_sql_mysql: Mysql error 'Access denied for user 'root'@'202.117.54.251'
Can you connect from that IP to MySQL using the MySQL command-line program? If not, check the ACL's on the machine running MySQL. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
Thanks to all of you. I can connect to MySQL using MySQL command-line program. The problem seems having been resolved , yet not completely. I logined as super user "ygx" other than "root". And "FreeRADIUS + MySQL" works again. I didnt make any other changes except editing sql.conf to login as user "ygx". The problem maybe exist in the table "user " of the database "mysql", which is as follow: mysql> select Host,User,Password from user; +-------------------------------+--------+-----------------------------------------------------------------------------------+ | Host | User | Password | +-------------------------------+--------+-----------------------------------------------------------------------------------+ | localhost | root | *639C78D0EC361EE7FBD5E7B2EE7D4356079DB335 | | 202.117.54.251 | root | *639C78D0EC361EE7FBD5E7B2EE7D4356079DB335 | | % | ygx | * 95FF347796503B19B351447515672881EB314534 | | % | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | +------------------------------+---------+-----------------------------------------------------------------------------------+ Note that user 'root' has different Password . Regards Guoxian. 2007/5/15, Alan Dekok <aland@deployingradius.com>:
yao guoxian wrote: ...
rlm_sql_mysql: Couldn't connect socket to MySQL server root@202.117.54.251:radius rlm_sql_mysql: Mysql error 'Access denied for user 'root'@'202.117.54.251'
Can you connect from that IP to MySQL using the MySQL command-line program? If not, check the ACL's on the machine running MySQL.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Tuesday 15 May 2007 09:39:55 yao guoxian wrote:
I have installed FreeRADIUS and MySQL on the same machine. "FreeRADIUS + MySQL" had worked well before Server IP changed. For some reason the server had to be carried to a new place and its IP must be changed. After the server IP changed, "FreeRADIUS + MySQL" does not work. I have edited sql.conf and changed IP to the new correct IP . I also edited the table "user" in the database "mysql" and altered the Host field from the old IP to the new correct IP. However these mendings do not work.
As Alan stated, try connecting to MySQL from the command line to confirm that it works. You updated the IPs in mysql.user, but that doesn't affect the MySQL permissions. To apply any changes to the mysql privilege tables, you must either restart the MySQL service or run "FLUSH PRIVILEGES". Kevin Bonner
participants (4)
-
Alan Dekok -
Kevin Bonner -
Stefan Winter -
yao guoxian