Как подключиться к MySQL на общем хосте?

1763

Я веб-разработчик, и мне просто интересно, почему я не могу подключиться к базе данных mysql практически на всех моих веб-сайтах с помощью командной строки (все темы используют cpanel), и когда я увидел, что порт 3306 закрыт !!

Как я могу подключить тему с помощью команды MySQL?

Почему порт mysql показан закрытым? Как это работает, если порт закрыт?

Это то, что делает Cpanel?

моя команда:

mysql -h remoteipaddress -u имя пользователя -pmypassword -D моя база данных

1

2 ответа на вопрос

0
gold member

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 http://domainname.com/cpanel) remote hosts can be added which the server allows to connect to the MySQL service.

0
Sam

I use SQLyog to connect to remote hosts. And this link - https://answers.syr.edu/display/ischool/Enable+Remote+MySQL+on+cPanel - gives the steps to connect to the MySQL database remotely when using cpanel.