Using al andalus as a convenient phrase for the successive political entities in the southern Peninsula following the Arab conquest.
The term pre-dates the Romans, and is a Greek term μαυρός, from the more common ἀμαυρός "dark, dim, faint." Its Greek etymology is unknown, and it might be a loan-word from Scythian maurva- per Beekes. It's route to "Moor" is as follows:
Greek Mαυρός, probably to describe the inhabitants of North Africa in the Classical or even pre-Classical period, or else the Greek version of a native North African toponym.
Latin Maurus, thence the regional name Mauretania
Late Latin Morus
Old French More
English "Moor"
I'm not as sure about Al Andalus, and I don't have any Arabic etymological sources, but the name Andalusia to refer to southern Spain is from Late Latin Vandalicia, "land of the Vandals."