A database should not be an actor in a use-case diagram. A use case diagram is meant to represent the purpose of your system for its actors, independently of the system's internal structure.
Databases are in general components used to implement a system. So it is part of the system's internals. Actors must be external to the system. The same reasoning applies, even if the database would be on another server or in the cloud.
Actors may however represent independent systems that interact with your system. In this case, some degree of autonomy is expected since they play a role in the use case: either the system actor supports the use-case, like a human actor could do, or it uses the system for achieving its own goals. For example credit rating services, or banking systems could be such autonomous systems.
Some useful questions may help to decide about candidate system actors: does the user need to know? are users or business stakeholders interested in this detail for business reasons? is the system actor a system that would still be useful if your system wouldn’t exist? could we imagine the same use case with a human user instead of a system actor?