Re: how to specify password for rasqlinsert ?
Carter Bullard <[email protected]> Mon, 22 Jul 2019 12:14:00 -0400
| Newsgroups | gmane.network.argus |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_A74E2ACA-1285-4219-B777-16358761B93B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey Russell, Are you getting this error message ?? % rasqlinsert -Xw = mysql://carter:password@localhost/test/table_2019_07_09 = <mysql://carter:password@localhost/test/table_2019_07_09> rasqlinsert[108003]: 10:42:26.420175 mysql_connect error Access denied = for user 'carter'@'localhost' (using password: YES) I tested this quite a bit and it works for me to pass the password like = above. We grab everything between the =E2=80=98:=E2=80=99 and the = =E2=80=98@=E2=80=98 and present that as the password to mysql_connect(). = If your password has characters that the shell may not like, I think = that quoting them, escaping, whatever, shouldl help, but if you put the = quotes around just the password, they will be included in the text we = present as the password. You can set the password in your .rarc file using the RA_DB_PASS = variable, something like: RA_DATABASE=3D=E2=80=9Ctest=E2=80=9D RA_DB_USER=3D=E2=80=9Ccarter=E2=80=9D RA_DB_PASS=3D=E2=80=9Cpassword=E2=80=9D You maybe running into other permission problems, since you=E2=80=99re = using rasqlinsert(). The user will need create permissions for = databases and tables, which maybe another problem. Carter > On Jul 22, 2019, at 12:07 AM, Russell Fulton <[email protected]> = wrote: >=20 > I am looking at producing hourly tables of flow summaries using = rasqlinsert but I can=E2=80=99t figure out how to give the mysql = password. >=20 > I tried the standard mysql://user:pass@localhost/=E2=80=A6. I put the = whole string in single quotes to protect the special characters - I also = tried escaping the specials. >=20 > Creds work fine in the mysql -u =E2=80=A6. -p >=20 >=20 > Russell > _______________________________________________ > argus mailing list > [email protected] > https://pairlist1.pair.net/mailman/listinfo/argus --Apple-Mail=_A74E2ACA-1285-4219-B777-16358761B93B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Hey = Russell,<div class=3D"">Are you getting this error message ??</div><div = class=3D""><br class=3D""></div><div class=3D"">% rasqlinsert -Xw <a = href=3D"mysql://carter:password@localhost/test/table_2019_07_09" = class=3D"">mysql://carter:password@localhost/test/table_2019_07_09</a></di= v><div class=3D""><div style=3D"margin: 0px; font-stretch: normal; = line-height: normal;" class=3D""><span style=3D"font-variant-ligatures: = no-common-ligatures;" class=3D"">rasqlinsert[108003]: 10:42:26.420175 = mysql_connect error Access denied for user 'carter'@'localhost' (using = password: YES)</span></div><div style=3D"margin: 0px; font-stretch: = normal; line-height: normal;" class=3D""><span = style=3D"font-variant-ligatures: no-common-ligatures;" class=3D""><br = class=3D""></span></div><div style=3D"margin: 0px; font-stretch: normal; = line-height: normal;" class=3D""><span style=3D"font-variant-ligatures: = no-common-ligatures;" class=3D"">I tested this quite a bit and it works = for me to pass the password like above. We grab everything between = the =E2=80=98:=E2=80=99 and the =E2=80=98@=E2=80=98 and present that as = the password to mysql_connect(). </span> If your password has = characters that the shell may not like, I think that quoting them, = escaping, whatever, shouldl help, but if you put the quotes around just = the password, they will be included in the text we present as the = password.</div><div style=3D"margin: 0px; font-stretch: normal; = line-height: normal;" class=3D""><span style=3D"font-variant-ligatures: = no-common-ligatures;" class=3D""><br class=3D""></span></div><div = style=3D"margin: 0px; font-stretch: normal; line-height: normal;" = class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures;" = class=3D"">You can set the password in your .rarc file using the = RA_DB_PASS variable, something like:</span></div><div style=3D"margin: = 0px; font-stretch: normal; line-height: normal;" class=3D""><span = style=3D"font-variant-ligatures: no-common-ligatures;" class=3D""> = RA_DATABASE=3D=E2=80=9Ctest=E2=80=9D</span></div><div = style=3D"margin: 0px; font-stretch: normal; line-height: normal;" = class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures;" = class=3D""> RA_DB_USER=3D=E2=80=9Ccarter=E2=80=9D</span></div>= <div style=3D"margin: 0px; font-stretch: normal; line-height: normal;" = class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures;" = class=3D""> RA_DB_PASS=3D=E2=80=9Cpassword=E2=80=9D</span></di= v><div style=3D"margin: 0px; font-stretch: normal; line-height: normal;" = class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures;" = class=3D""><br class=3D""></span></div><div style=3D"margin: 0px; = font-stretch: normal; line-height: normal;" class=3D"">You maybe running = into other permission problems, since you=E2=80=99re using = rasqlinsert(). The user will need create permissions for databases = and tables, which maybe another problem.</div><div style=3D"margin: 0px; = font-stretch: normal; line-height: normal;" class=3D""><br = class=3D""></div><div style=3D"margin: 0px; font-stretch: normal; = line-height: normal;" class=3D"">Carter</div><div class=3D""><div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">On Jul = 22, 2019, at 12:07 AM, Russell Fulton <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">I am = looking at producing hourly tables of flow summaries using rasqlinsert = but I can=E2=80=99t figure out how to give the mysql password.<br = class=3D""><br class=3D"">I tried the standard <a = href=3D"mysql://user:pass@localhost/" = class=3D"">mysql://user:pass@localhost/</a>=E2=80=A6. I put the whole = string in single quotes to protect the special characters - I also tried = escaping the specials.<br class=3D""><br class=3D"">Creds work fine in = the mysql -u =E2=80=A6. -p<br class=3D""><br class=3D""><br = class=3D"">Russell<br = class=3D"">_______________________________________________<br = class=3D"">argus mailing list<br class=3D""><a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a><br = class=3D"">https://pairlist1.pair.net/mailman/listinfo/argus<br = class=3D""></div></div></blockquote></div><br = class=3D""></div></div></body></html>= --Apple-Mail=_A74E2ACA-1285-4219-B777-16358761B93B--