0

I have mariadb server, which contains database and i have my website on apache server that connects to this database through PHP and my general logs seems like this: logs and i dont like it shows "as anonymous" instead of for example "as apache". Can i somehow configure my apache server to integrate with it? Or should i use other logs than general_logs to get information what exactly send that query? My system is Fedora 33.

M3zuss
  • 45
  • 4
  • 1
    Please post data as text here instead of an external picture. – Allan Wind Oct 28 '21 at 23:27
  • Here are the [reasons for why we don't like text posted as images on stackoverflow](https://meta.stackoverflow.com/a/285557/13447). Please edit your question to contain all the information in text form - consider to use the editor's formatting options. Also see [ask] and consider to take the [tour]. – Olaf Kock Oct 29 '21 at 07:40

1 Answers1

0

Some MySQL installations permit users to connect as the anonymous (unnamed) user to the server running on the local host.1

and if you head over to dba forum you find this on how to disable those:

https://dba.stackexchange.com/questions/51452/how-do-you-disable-anonymous-login

Subsequently you want to update your PHP configuration to login with the new credentials.

Allan Wind
  • 23,068
  • 5
  • 28
  • 38
  • well the problem is that i dont have any anonymous users in my database. My PHP uses credentials of "testuser" who has full privilages to this database and in logs you can see line testuser@localhost as anonymous on testy(its the name of database). So in my understanding something logged as testuser on localhost and executed query, and my problem is that i want to configure apache to know exactly that it was apache that executed that query. – M3zuss Oct 28 '21 at 23:44
  • 1
    Please update question with ` select user,host,length(password) from mysql.user;` Your log event disagrees with your assertion that you don't have any anonymous users. What makes you think it's an apache configuration? Apache, by default, doesn't know about mysql. Are you using libapache2-mod-auth-mysql perhaps? – Allan Wind Oct 29 '21 at 07:10