Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrated authentication for mysql

When working with MSSQL on Windows I was used to a very convenient feature called integrated authentication. In short, being authenticated in Windows can give you access to the database, so no need to give any specific password. Now I am developing an application on Linux with no user interaction; this application needs to access a mysql database for its own purposes, so how do I let it login? I have found that even though by default a root account is created in mysql, this root account has no connection with unix root, I can use it even if I am not a superuser in Linux, and the password is blank. Of course I can create a dedicated user account in mysql for the needs of my application, but in this case I need to hard-code the password somewhere, which is not nice. Once again - there is no user interaction in my application, so no chance for someone to enter the password. I have a distinct feeling that I am missing something important here. Thanks for any advice!

like image 744
azerole Avatar asked Apr 23 '26 23:04

azerole


1 Answers

First, you really should set a password on the mysql root account...

Second, yeah, you're pretty much going to have to put the password somewhere, unless you set up the application account to use a blank password too...

like image 97
genehack Avatar answered Apr 26 '26 13:04

genehack



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!