You can use silicone sealant; it will should on the tube whether it's safe for aquariums or not; many of the bathroom ones will have a fungicide that's extremely toxic to fish, but it's not that good at 'glueing' things together.
Or there's cyanoacrylate superglue; again, it will say on the packaging what ingredients are in it and you want one that's pure cyanoacrylate, with no other ingredients. The cheap stuff from your pond/dollar store is usually the right kind.
Another option might be the two part epoxy resins (the ones you where knead two pastes together) They're often sold in LFS for marine tanks, for holding down corals and the like.