It may look nothing like it, but the only letter that really differs is the -c-. The -x is pronounced as -sh and -b- isn't that far removed from -n-, especially in a language with a nasal -a- like Portuguese.
Is Portuguese your native language? I can’t see how one would pronounce abacaxi in a way that sounds like ananas.