I
I
IvanRobot2016-05-26 00:24:34
PHP
IvanRobot, 2016-05-26 00:24:34

How to connect to the database in Bitrix?

I can make sql queries from the Bitrix admin panel, but when I try to connect from the terminal, I write:

ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (111)

From file dbconn.php:
define("DBPersistent", false);
$DBType = "mysql";
$DBHost = "localhost";
$DBLogin = login_223";
$DBPassword = "768648fdnfdjh";
$DBName = "Name_34";
$DBDebug = true;
$DBDebugToFile = false;
define("MYSQL_TABLE_TYPE", "INNODB");

Naturally, it does not connect to the localhost .. it is simply registered in the config. I tried to specify the host on which the site is located, but the result was the same.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Express777, 2016-05-27
@Express777

I tried to specify the host on which the site is located, but the result was the same.

Many hostings cut off the connection to the database from the external server, leaving access only to local servers.
Do you have shared hosting?

E
Eugene, 2016-05-26
@e-antonov

Show how you connect from the terminal.

1
1001001, 2016-05-26
@1001001

Perhaps you need to look for settings not in dbconn.php but in site/bitrix/.settings.php

V
Viktor Taran, 2016-05-27
@shambler81

.settings.php - you've already been given the correct answer.
Since version 15.5, Bitrix has a glitch, you need to manually edit this file
. Since it is not automatically updated, and when you add it to dbcon, you also need to edit .settings.php
In fact, entering the same thing, why? this is really a bug or a too cunning move by a knight that is not possible for a normal person to understand.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question