Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am web developer and i just wonder Why i can't connect to mysql database on almost all my website with command line (all of theme use cpanel) and when i saw that port 3306 is closed !!

How could i connect theme with mysql command ?

Why mysql port is shown closed ? How it work if it's port is closed ?

Is that something Cpanel do ?

my command is :

mysql -h remoteipaddress -u username -pmypassword -D mydatabase

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Remote MySQL connections are disabled by default in cPanel servers because they are considered a potential security threat. Using the tools in the Web Host Manager (WHM) and the domain-level cPanel interface (usually remote hosts can be added which the server allows to connect to the MySQL service.

share|improve this answer

I use SQLyog to connect to remote hosts. And this link - - gives the steps to connect to the MySQL database remotely when using cpanel.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.