Its source is Merfyn, a Welsh name meaning "Sea friend."
Through a mistake in interpretation, this name has been identified with the wizard who tutored King Arthur in British legend. He was known as Myrddin Emrys. Writers translated this into Latin as Merlin Ambrosius, and into English as Mervyn, in the mistaken belief that the first part of the name was personal. It was, however, a place name -- the Welsh name for the seacoast town of Carmarthen. Emrys was the personal name -- a Welsh version of Ambrose.
So ''Ambrose of Carmarthen'' is possibly the best interpretation of Merlin's name, and as such it is only vaguely related to Mervyn and its variant spellings and forms.