Ошибка подключения к mysql connection refused brainycp

Здесь VPS на BrainyCP за 2$ в месяц, а здесь 50GB шаред-хостинг на BrainyCP за 1.9$ в месяц

dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Непонятно куда исчезли ранее созданные почтовые ящики. Черт с ними ящиками, а вот то, что база smtp сама не создается в случае ее отсутствия — плохо. Я вот сейчас просто не знаю с каким логином и паролем эту базу делать, чтобы почтовые ящики заработали.

Изображение


Аватара пользователя

alenka

Сообщения: 1609
Зарегистрирован: Ср сен 27, 2017 11:10 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

alenka » Вт апр 23, 2019 9:24 am

Базы данные для работы с почтой и другими сервисами, нельзя удалять (phpmyadmin, smtp,roundcubemail,и т.д )
Вам нужно переустановить почтовые сервисы, по ссылке :8002/?do=mailserver&module=massinstall


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Вт апр 23, 2019 10:42 am

alenka писал(а): ↑

Вт апр 23, 2019 9:24 am

Базы данные для работы с почтой и другими сервисами, нельзя удалять (phpmyadmin, smtp,roundcubemail,и т.д )
Вам нужно переустановить почтовые сервисы, по ссылке :8002/?do=mailserver&module=massinstall

Дело в том, что я ничего не удалял. Единственное изменение, которые было с момента установки панели это замена MySQL 5.6 на MariaDB 10.3, что возможно и могло такой результат дать в теории. За совет спасибо, попробую.


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 6:31 am

alenka писал(а): ↑

Вт апр 23, 2019 9:24 am

Базы данные для работы с почтой и другими сервисами, нельзя удалять (phpmyadmin, smtp,roundcubemail,и т.д )
Вам нужно переустановить почтовые сервисы, по ссылке :8002/?do=mailserver&module=massinstall

Установил, но ничего не изменилось, та же ошибка. Кстати, у меня phpMyAdmin выдает:

Это не может быть из-за того, что вот этих баз, которые вы перечислили (phpmyadmin, smtp,roundcubemail,и т.д ) я соответствующим каталоге не наблюдаю? Очень похоже на то, что они были удалены в процессе установки MariaDB.

Их можно как-то восстановить через панель или теперь только создавать вручную? Если вручную, то с какими параметрами их нужно создавать?


Аватара пользователя

alenka

Сообщения: 1609
Зарегистрирован: Ср сен 27, 2017 11:10 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

alenka » Ср апр 24, 2019 7:08 am

Вы сторонние репозитарии подключали?
Вручную пароль к базе меняли?
Выполняется данная команда?
mysql -uroot -p`echo $(cat /etc/brainy/conf/mysql | grep root | grep -Eoi ‘[a-z0-9]+$’)` -e «show databases;»

покажите вывод ls -al /etc/yum.repos.d/
И покажите вывод rpm -qa | grep maria


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 7:48 am

alenka писал(а): ↑

Ср апр 24, 2019 7:08 am

Вы сторонние репозитарии подключали?
Вручную пароль к базе меняли?
Выполняется данная команда?
mysql -uroot -p`echo $(cat /etc/brainy/conf/mysql | grep root | grep -Eoi ‘[a-z0-9]+$’)` -e «show databases;»

покажите вывод ls -al /etc/yum.repos.d/
И покажите вывод rpm -qa | grep maria

Ничего стороннего не подключал. Пароли вручную тоже не менял, да и вообще никак не трогал системные базы. Команда выполняется:

Код: Выделить всё

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| optima_doska       |
| optima_gena        |
| optima_gospro      |
| optima_grazhd      |
| optima_kredit      |
| optima_medkom      |
| optima_netpro      |
| optima_propiska    |
| optima_rvp74rf     |
| optima_voennik     |
| performance_schema |
+--------------------+

Единственное, что я делал, это менял предустановленную MySQL 5.6 на MariaDB 10.3 — при этом делал это не через консоль, а через панель управления в соответствующем разделе. Я когда BrainCP ставил, в начальной конфигурации выбрал MySQL 5.6 и видимо зря, потому что он периодически падал, после замены на MariaDB падения пропали.

Репо:

Код: Выделить всё

[root@rvp74 ~]# ls -al /etc/yum.repos.d/
total 48
drwxr-xr-x   2 root root  206 Apr 23 09:39 .
drwxr-xr-x 105 root root 8192 Apr 24 10:13 ..
-rw-r--r--   1 root root 1005 Apr 23 09:39 brainy.repo
-rw-r--r--   1 root root 1664 Nov 23 18:16 CentOS-Base.repo
-rw-r--r--   1 root root 1309 Nov 23 18:16 CentOS-CR.repo
-rw-r--r--   1 root root  649 Nov 23 18:16 CentOS-Debuginfo.repo
-rw-r--r--   1 root root  314 Nov 23 18:16 CentOS-fasttrack.repo
-rw-r--r--   1 root root  630 Nov 23 18:16 CentOS-Media.repo
-rw-r--r--   1 root root 1331 Nov 23 18:16 CentOS-Sources.repo
-rw-r--r--   1 root root 5701 Nov 23 18:16 CentOS-Vault.repo

Пакеты:

Код: Выделить всё

[root@rvp74 ~]# rpm -qa | grep maria
mariadb-libs-5.5.52-201.el7.centos.x86_64
mariadb10.3-common-10.3.7-10.el7.centos.x86_64
mariadb10.3-libs-10.3.7-10.el7.centos.x86_64
mariadb10.3-server-utils-10.3.7-10.el7.centos.x86_64
mariadb10.3-server-10.3.7-10.el7.centos.x86_64
mariadb10.3-10.3.7-10.el7.centos.x86_64

Аватара пользователя

alenka

Сообщения: 1609
Зарегистрирован: Ср сен 27, 2017 11:10 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

alenka » Ср апр 24, 2019 7:56 am

Смотрите, по списку баз которые у вас есть на скринах.
Вам нужно переустановить phpmyadmin (так как нет для него базы)
Переустановить почтовые сервисы (Для них тоже нет баз)
В этом же посту, указана ссылка для переустановки сразу всех почтовых сервисов.


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 8:15 am

alenka писал(а): ↑

Ср апр 24, 2019 7:56 am

Смотрите, по списку баз которые у вас есть на скринах.
Вам нужно переустановить phpmyadmin (так как нет для него базы)
Переустановить почтовые сервисы (Для них тоже нет баз)
В этом же посту, указана ссылка для переустановки сразу всех почтовых сервисов.

Там по этой ссылке две кнопки: Установить и Удалить любые связи.

Кнопку Установить уже пробовал. Значит мне надо кнопкой удалить воспользоваться? Или нет?



dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 9:34 am

alenka писал(а): ↑

Ср апр 24, 2019 8:53 am

Нажмите установить.

Уже пробовал. Вообще, есть желание обнулить сервер и заново поставить BrainyCP (с теми же логинами и паролями).

Если не сложно, можете подсказать, какие директории копировать и какие файлы редактировать, чтобы все сайты и базы данных от сайтов потом корректно отобразились в новой панели?

Думаю такая инструкция была бы полезной не только мне — типа универсальный способ решения всех проблем.

Также такую инструкцию можно было бы рассматривать как эдакий гайд для тех, кто хочет мигрировать на другой хостинг.

Может действительно составите инструкцию по переносу сайтов с одного BrainyCP на другой чистый BrainyCP?

Это бы и вашу работу облегчило — со слишком хитрыми проблема можно отправлять на эту инструкцию и если проблема сохраняется на чистой системе уже идти разбираться.

Последний раз редактировалось dima Ср апр 24, 2019 9:40 am, всего редактировалось 1 раз.


Are you looking for an answer to the topic “php mysql connection refused“? We answer all your questions at the website barkmanoil.com in category: Newly updated financial and investment news for you. You will find the answer right below.

Keep Reading

Php Mysql Connection Refused

Php Mysql Connection Refused

Which of the following function command in PHP is used to connect MySQL database?

The connect() / mysqli_connect() function opens a new connection to the MySQL server.

How do I fix MySQL connection refused?

Resolution

  1. Open /etc/mysql/my.cnf in a text editor.
  2. Change the bind-address = 192.X.X.X to bind-address = 127.0.0.1 and save.
  3. Restart MySQL service.
  4. Use netstat -tln to verify that MySQL is listening in localhost 127.0. 0.1:3306 port.

(HY000/2002): Connection refused Docker compose

(HY000/2002): Connection refused Docker compose

(HY000/2002): Connection refused Docker compose

Images related to the topic(HY000/2002): Connection refused Docker compose

(Hy000/2002): Connection Refused Docker Compose

(Hy000/2002): Connection Refused Docker Compose

How do you connect MySQL database with PHP?

  1. Create Database.
  2. Create a Folder in htdocs.
  3. Create Database Connection File In PHP.
  4. Create new php file to check your database connection.
  5. Run it.

Can not connect to MySQL in PHP?

PHP may not be able to connect to the MySQL server if the server name is not recognized. Make sure that the server name is set to localhost. In case of other errors, make sure to consult the error_log file to help when trying to solve any issues. The file is located in the same folder where the script is running.

How do I connect to a MySQL database?

To Connect to a MySQL Database

  1. Click Services tab.
  2. Expand the Drivers node from the Database Explorer. …
  3. Enter User Name and Password. …
  4. Click OK to accept the credentials. …
  5. Click OK to accept the default schema.
  6. Right-click the MySQL Database URL in the Services window (Ctrl-5).

How configure Mysqli in PHP?

It’ll automatically enable the mysqli extension for the PHP because connect using mysql is deprecated in PHP 7. If not an Ubuntu user then you can just rename php-prodcution. ini file to php. ini and enable the extension by removing semicolon in the php.

Can’t connect to database connection refused?

A Connection Refused (Hostname) error occurs when: You use the wrong port in the connection string. You connect from a machine that is not in the database’s list of trusted sources.


See some more details on the topic php mysql connection refused here:


mysql_connect(): Connection refused – php – Stack Overflow

Connections are refused from remote locations to MySQL for security reasons. You can add your IP Address to enable MySQL to listen from your …

+ View More Here

Connection refused by MySQL server? – HeidiSQL

I’ve compiled a server software package on Ubuntu, installed MySQL, and am attempting to connect to my server’s MySQL databases with …

+ Read More Here

mysql_connect – Manual – PHP

mysql_connect — Open a connection to a MySQL Server. Warning … I usually use MySQLi extension, but also tried MySQL, and both refused to work.

+ View More Here

How do I fix the Mysql error “Connection refused”? – Matomo …

Check that your config file config/config.ini.php (in the Matomo directory) contains the correct and up to date DB credentials under the [database] section.

+ Read More

How do I connect to a local MySQL server?

Step 3: Connect to a Local MySQL Server

Enter mysql.exe -uroot -p , and MySQL will launch using the root user. MySQL will prompt you for your password. Enter the password from the user account you specified with the –u tag, and you’ll connect to the MySQL server.

Can’t connect to local MySQL server?

Another possible solution to the >can’t connect to local mysql server through socket> error message is to try and connect to the MySQL using the 127.0. 0.1 ip address instead of localhost. When you use localhost to connect to MySQL, the operating system uses the socket connector.

How do I know if MySQL is PHP connected?

It’s very simple concept, first the “mysql_connect” argument will check the database hostname, username and password. If the first argument is true, then PHP take the second line to execute else the script will die with an output given in the Die section. Similarly, mysql_select_db check the database on the server.

Which PHP class can be used to connect to a MySQL database?

PHP 5 and later can work with a MySQL database using: MySQLi extension (the “i” stands for improved) PDO (PHP Data Objects)

How will you create a connection between PHP and MySQL step by step?

How to Connect PHP to MySQL Database

  1. Connect PHP applications with MySQL (and MariaDB).
  2. Retrieve database server information.
  3. Manage errors generated from database calls.
  4. Work with database records using the Create, Read, Update, and Delete (CRUD) functions.

PHP Connect to MySQL Database | 2 Methods

PHP Connect to MySQL Database | 2 Methods

PHP Connect to MySQL Database | 2 Methods

Images related to the topicPHP Connect to MySQL Database | 2 Methods

Php Connect To Mysql Database | 2 Methods

Php Connect To Mysql Database | 2 Methods

How can you connect to MySQL from PHP Mcq?

In PHP in order to access MySQL database you will use:

mysql-connect() function. mysql_connect() function. sql_connect() function.

What is Mysql_select_db () function?

mysql_select_db() sets the current active database on the server that’s associated with the specified link identifier. If no link identifier is specified, the last opened link is assumed. If no link is open, the function will try to establish a link as if mysql_connect() was called without arguments, and use it.

What port is MySQL?

Client – Server Connection Ports

Port 3306 is the default port for the classic MySQL protocol ( port ), which is used by the mysql client, MySQL Connectors, and utilities such as mysqldump and mysqlpump.

How do I fix database connection error?

How To Fix “Error Establishing a Database Connection”

  1. Step 1: Get In Touch With Your Web Host Provider. …
  2. Step 2: Check If Your Plugin or Theme Files Haven’t Been Corrupted. …
  3. Step 3: Check If Your Database Hasn’t Been Corrupted. …
  4. Step 4: Check Your Database Connection Credentials. …
  5. Step 5: Restore The Default WordPress Files.

What is the database for PHP?

MySQL is the most popular database system used with PHP.

What is the connection string for MySQL?

Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword; The port 3306 is the default MySql port. The value is ignored if Unix socket is used.

What is difference between MySQL and MySQLi in PHP?

Basically, MySQL is the old database driver, and MySQLi is the Improved driver. The “i” stands for “improved” so it is MySQL improved. MySQLi can be done procedural and object-oriented whereas MySQL can only be used procedurally. Mysqli also supports prepared statements which protect from SQL Injection.

Does PHP come with MySQLi?

Installation ¶

The mysqli extension was introduced with PHP version 5.0. 0. The MySQL Native Driver was included in PHP version 5.3.

How do I fix MySQLi extension is missing please check PHP configuration?

Answer

  1. Go to your php_mysqli. dll path (in my case: C:/xampp/php/ext);
  2. Move the php_mysqli. dll to the previous folder (C:/xampp/php);
  3. Open php. …
  4. Change to the path where is your file: extension=”C:xamppphpphp_mysqli. …
  5. Restart your application (wampp, xampp, etc.)

Why does localhost refuse to connect?

What Is the Localhost Refused to Connect Error? The localhost simulates a web server running on your computer. When the “localhost refused to connect” error appears, it is likely due to misconfigured port. Other common reasons include insufficient permissions and the Apache webserver not running properly.


[Laravel] Fix SQLSTATE[HY000] [2002] Connection refused

[Laravel] Fix SQLSTATE[HY000] [2002] Connection refused

[Laravel] Fix SQLSTATE[HY000] [2002] Connection refused

Images related to the topic[Laravel] Fix SQLSTATE[HY000] [2002] Connection refused

[Laravel] Fix Sqlstate[Hy000] [2002] Connection Refused

[Laravel] Fix Sqlstate[Hy000] [2002] Connection Refused

How do I install MySQL?

The process for installing MySQL from a ZIP Archive package is as follows:

  1. Extract the main archive to the desired install directory. …
  2. Create an option file.
  3. Choose a MySQL server type.
  4. Initialize MySQL.
  5. Start the MySQL server.
  6. Secure the default user accounts.

How do I restart MySQL on Ubuntu?

How to Start/Stop MySQL Server on Ubuntu

  1. How to Start/Stop MySQL Server on Ubuntu. Topic: Ubuntu / LinuxPrev|Next. …
  2. sudo service mysql stop. To start MySQL server use the following command:
  3. sudo service mysql start. To restart MySQL server use the following command:
  4. sudo service mysql restart. …
  5. sudo service mysql status.

Related searches to php mysql connection refused

  • sqlstate[hy000] [2002] connection refused
  • php mysql connection refused 2002
  • phpmyadmin connection refused
  • php mysql examples
  • php mysql connection failed
  • php pdo mysql connection refused
  • php connect to mysql without password
  • sqlstatehy000 2002 connection refused
  • mysql with php example
  • connection failed connection refused php
  • php mysql not working
  • php not connecting to mysql
  • phpmyadmin mysql connection refused
  • phpstorm mysql connection refused
  • php not closing mysql connections
  • connection failed connection refused php mysql
  • connection failed: connection refused php
  • mysqli real connect hy0002002 connection refused
  • mysql php connection example
  • pdo connection refused
  • docker phpmyadmin mysql connection refused
  • php artisan migrate connection refused mysql
  • docker php mysql connection refused

Information related to the topic php mysql connection refused

Here are the search results of the thread php mysql connection refused from Bing. You can read more if you want.


You have just come across an article on the topic php mysql connection refused. If you found this article useful, please share it. Thank you very much.

The Network error IOException: Connection refused means that there is no database server listening on the specified port on the IP address. To troubleshoot, please control following:

Erroneous server name/IP

Please ensure that you are using the correct servername/IP to Discover the MSSQL server

SQL Server is not configured to use TCP/IP

Check if TCP/IP is configured on the SQL Server:

  1. Open the Configuration Manager:
    Start -> Microsoft SQL Server -> Configuration Tools -> SQL Server Configuration Manager
  2. Enable the TCP/IP: from the left hand tree choose:
    SQL Server Network Configuration-> Protocol for SQLEXPRESS-> TCP/IP
    Right click and enable it.
  3. Double click the TCP/IP and click on the “IP Addresses” Tab
  4. Adding TCP/IP port : Enter TCP Port value to 1433 then click apply
  5. Restart SQL Server: from the left hand tree, choose:
    SQL Server Services -> SQL Server (SQLEXPRESS) -> right click and restart.

There is a firewall blocking the specified port on the server

vScope is running Discoveries on the default port 1433. Ensure that this port is open and accessible from the vScope server.

SQL instance is running on dynamic ports

When I try to connect to a local mysql database using it’s remote ip-address I get a access denied. When I try to connect to that same database from an external machine, it works without any problems. When I connect to the local database using localhost, it works perfectly as well. E.g., if the database server has the ip 1.2.3.4 then I get the following results:

# From the db server
mysql -u username -h localhost -p #works perfectly
mysql -u username -h 127.0.0.1 -p #works perfectly
mysql -u username -h 1.2.3.4 -p #Access denied

# From any other machine
mysql -u username -h 1.2.3.4 -p #works perfectly

What can I do to allow local access to my database using its remote ip-address? The OS of the database server is Fedora 15 and the MySQL version is 5.5.23.

asked Oct 23, 2012 at 14:03

Tiddo's user avatar

TiddoTiddo

6,2996 gold badges51 silver badges85 bronze badges

3

Try to edit/add bind-address = 0.0.0.0 to your [mysqld] section of your /etc/mysql/mysql.conf.d/mysqld.cnf file and restart MySQL Service.

answered Jun 29, 2018 at 18:01

Eduardo Cuomo's user avatar

Eduardo CuomoEduardo Cuomo

17.6k6 gold badges114 silver badges93 bronze badges

5

I found the solution to my problem myself, but I still don’t quite understand why it didn’t work:

I granted privileges to that user on the hosts % and localhost:

# Before
+-----------------+------------+
| Host            | User       |
+-----------------+------------+
| %               | username   |
| localhost       | username   |
+-----------------+------------+

With these settings I got the results I showed above. When I granted privileges to that user on host it suddenly did work.

# After
+-----------------+------------+
| Host            | User       |
+-----------------+------------+
| %               | username   |
| localhost       | username   |
| <myIpAddress>   | username   |
+-----------------+------------+

Apparently % does work for remote connections, but not for local connections.

answered Oct 23, 2012 at 15:00

Tiddo's user avatar

TiddoTiddo

6,2996 gold badges51 silver badges85 bronze badges

1

This particular issue can be caused by host name resolution.

I have resolved it in my particular case by deleting this variable from my my.cnf config file:

skip-name-resolve

Either remark the variable by placing a pound sign # or just delete it from your my.cnf after making sure you back it up, of course.

Eduardo Cuomo's user avatar

answered Sep 5, 2013 at 16:01

Victor F.'s user avatar

  • Home
  • Help
  • Installation & Maintenance
  • Matomo On-Premise (self-hosted)
  • Troubleshoot Database

The MySQL server error SQLSTATE[HY000] [2002] Connection refused. can be caused by several reasons, if you follow the steps below you should be able to fix this issue:

  • Check that your config file config/config.ini.php (in the Matomo directory) contains the correct and up to date DB credentials under the [database] section. Check that the DB username, DB password, database host, and database port are correct. (if you are unsure, reach out to your database administrator or check in your web hosting account for the up to date credentials).
  • If the config file references host = "localhost", you can try to change it to 127.0.0.1 instead, for example in your config.ini.php under [database] set host = "127.0.0.1".
  • If the above changes do not resolve the issue, we recommend you try to connect to MySQL on the command line to check if the credentials are correct and the server works. Connect to the server running Matomo and run this command: mysql -h [hostname] -u [username] -p[password] -D [dbname] (and replace the parameters in [] by the values found in your config.ini.php file.).
  • If the command above works, but you still get the “Connection refused” error in the browser, there may be an issue with PHP. Please reach out to your web hosting company or system administrator.
  • Check that the MySQL Server is running. Connect to the server running the MySQL database and check if the MySQL server is actively running by running this command mysqladmin -u root -p status (which should return an output like this: Uptime: 172505 Threads: 2 Questions: 90 Slow queries: 0 Opens: 157 Flush tables: 3 Open tables: 76)
  • If you find the DB server is not running, proceed to restart Mysql server (or rebooting the whole server).
  • Or If the Database server have run out of disk space and there is no space left on the server, it may also start to refuse connections.
  • Sometimes MySQL servers are configured to refused some connections (for example connections from outside the network). If your MySQL database is managed by your web hosting company, contact them as they may be able to help.

If you still have the SQLSTATE[HY000] [2002] Connection refused. after checking the steps above, feel free to reach out to us by clicking the feedback button below.

Previous FAQ: How do I fix the error “Mysql Server has gone away”?

Здесь VPS на BrainyCP за 2$ в месяц, а здесь 50GB шаред-хостинг на BrainyCP за 1.9$ в месяц

dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Непонятно куда исчезли ранее созданные почтовые ящики. Черт с ними ящиками, а вот то, что база smtp сама не создается в случае ее отсутствия — плохо. Я вот сейчас просто не знаю с каким логином и паролем эту базу делать, чтобы почтовые ящики заработали.

Изображение


Аватара пользователя

alenka

Сообщения: 1622
Зарегистрирован: Ср сен 27, 2017 11:10 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

alenka » Вт апр 23, 2019 9:24 am

Базы данные для работы с почтой и другими сервисами, нельзя удалять (phpmyadmin, smtp,roundcubemail,и т.д )
Вам нужно переустановить почтовые сервисы, по ссылке :8002/?do=mailserver&module=massinstall


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Вт апр 23, 2019 10:42 am

alenka писал(а): ↑

Вт апр 23, 2019 9:24 am


Базы данные для работы с почтой и другими сервисами, нельзя удалять (phpmyadmin, smtp,roundcubemail,и т.д )
Вам нужно переустановить почтовые сервисы, по ссылке :8002/?do=mailserver&module=massinstall

Дело в том, что я ничего не удалял. Единственное изменение, которые было с момента установки панели это замена MySQL 5.6 на MariaDB 10.3, что возможно и могло такой результат дать в теории. За совет спасибо, попробую.


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 6:31 am

alenka писал(а): ↑

Вт апр 23, 2019 9:24 am


Базы данные для работы с почтой и другими сервисами, нельзя удалять (phpmyadmin, smtp,roundcubemail,и т.д )
Вам нужно переустановить почтовые сервисы, по ссылке :8002/?do=mailserver&module=massinstall

Установил, но ничего не изменилось, та же ошибка. Кстати, у меня phpMyAdmin выдает:

Это не может быть из-за того, что вот этих баз, которые вы перечислили (phpmyadmin, smtp,roundcubemail,и т.д ) я соответствующим каталоге не наблюдаю? Очень похоже на то, что они были удалены в процессе установки MariaDB.

Их можно как-то восстановить через панель или теперь только создавать вручную? Если вручную, то с какими параметрами их нужно создавать?


Аватара пользователя

alenka

Сообщения: 1622
Зарегистрирован: Ср сен 27, 2017 11:10 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

alenka » Ср апр 24, 2019 7:08 am

Вы сторонние репозитарии подключали?
Вручную пароль к базе меняли?
Выполняется данная команда?
mysql -uroot -p`echo $(cat /etc/brainy/conf/mysql | grep root | grep -Eoi ‘[a-z0-9]+$’)` -e «show databases;»

покажите вывод ls -al /etc/yum.repos.d/
И покажите вывод rpm -qa | grep maria


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 7:48 am

alenka писал(а): ↑

Ср апр 24, 2019 7:08 am


Вы сторонние репозитарии подключали?
Вручную пароль к базе меняли?
Выполняется данная команда?
mysql -uroot -p`echo $(cat /etc/brainy/conf/mysql | grep root | grep -Eoi ‘[a-z0-9]+$’)` -e «show databases;»

покажите вывод ls -al /etc/yum.repos.d/
И покажите вывод rpm -qa | grep maria

Ничего стороннего не подключал. Пароли вручную тоже не менял, да и вообще никак не трогал системные базы. Команда выполняется:

Код: Выделить всё

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| optima_doska       |
| optima_gena        |
| optima_gospro      |
| optima_grazhd      |
| optima_kredit      |
| optima_medkom      |
| optima_netpro      |
| optima_propiska    |
| optima_rvp74rf     |
| optima_voennik     |
| performance_schema |
+--------------------+

Единственное, что я делал, это менял предустановленную MySQL 5.6 на MariaDB 10.3 — при этом делал это не через консоль, а через панель управления в соответствующем разделе. Я когда BrainCP ставил, в начальной конфигурации выбрал MySQL 5.6 и видимо зря, потому что он периодически падал, после замены на MariaDB падения пропали.

Репо:

Код: Выделить всё

[root@rvp74 ~]# ls -al /etc/yum.repos.d/
total 48
drwxr-xr-x   2 root root  206 Apr 23 09:39 .
drwxr-xr-x 105 root root 8192 Apr 24 10:13 ..
-rw-r--r--   1 root root 1005 Apr 23 09:39 brainy.repo
-rw-r--r--   1 root root 1664 Nov 23 18:16 CentOS-Base.repo
-rw-r--r--   1 root root 1309 Nov 23 18:16 CentOS-CR.repo
-rw-r--r--   1 root root  649 Nov 23 18:16 CentOS-Debuginfo.repo
-rw-r--r--   1 root root  314 Nov 23 18:16 CentOS-fasttrack.repo
-rw-r--r--   1 root root  630 Nov 23 18:16 CentOS-Media.repo
-rw-r--r--   1 root root 1331 Nov 23 18:16 CentOS-Sources.repo
-rw-r--r--   1 root root 5701 Nov 23 18:16 CentOS-Vault.repo

Пакеты:

Код: Выделить всё

[root@rvp74 ~]# rpm -qa | grep maria
mariadb-libs-5.5.52-201.el7.centos.x86_64
mariadb10.3-common-10.3.7-10.el7.centos.x86_64
mariadb10.3-libs-10.3.7-10.el7.centos.x86_64
mariadb10.3-server-utils-10.3.7-10.el7.centos.x86_64
mariadb10.3-server-10.3.7-10.el7.centos.x86_64
mariadb10.3-10.3.7-10.el7.centos.x86_64


Аватара пользователя

alenka

Сообщения: 1622
Зарегистрирован: Ср сен 27, 2017 11:10 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

alenka » Ср апр 24, 2019 7:56 am

Смотрите, по списку баз которые у вас есть на скринах.
Вам нужно переустановить phpmyadmin (так как нет для него базы)
Переустановить почтовые сервисы (Для них тоже нет баз)
В этом же посту, указана ссылка для переустановки сразу всех почтовых сервисов.


dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 8:15 am

alenka писал(а): ↑

Ср апр 24, 2019 7:56 am


Смотрите, по списку баз которые у вас есть на скринах.
Вам нужно переустановить phpmyadmin (так как нет для него базы)
Переустановить почтовые сервисы (Для них тоже нет баз)
В этом же посту, указана ссылка для переустановки сразу всех почтовых сервисов.

Там по этой ссылке две кнопки: Установить и Удалить любые связи.

Кнопку Установить уже пробовал. Значит мне надо кнопкой удалить воспользоваться? Или нет?



dima

Сообщения: 48
Зарегистрирован: Сб мар 30, 2019 11:11 am

Re: 1049:Unknown database ‘smtp’ Ошибка подключения к серверу баз данных MySql

Сообщение

dima » Ср апр 24, 2019 9:34 am

alenka писал(а): ↑

Ср апр 24, 2019 8:53 am


Нажмите установить.

Уже пробовал. Вообще, есть желание обнулить сервер и заново поставить BrainyCP (с теми же логинами и паролями).

Если не сложно, можете подсказать, какие директории копировать и какие файлы редактировать, чтобы все сайты и базы данных от сайтов потом корректно отобразились в новой панели?

Думаю такая инструкция была бы полезной не только мне — типа универсальный способ решения всех проблем.

Также такую инструкцию можно было бы рассматривать как эдакий гайд для тех, кто хочет мигрировать на другой хостинг.

Может действительно составите инструкцию по переносу сайтов с одного BrainyCP на другой чистый BrainyCP?

Это бы и вашу работу облегчило — со слишком хитрыми проблема можно отправлять на эту инструкцию и если проблема сохраняется на чистой системе уже идти разбираться.

Последний раз редактировалось dima Ср апр 24, 2019 9:40 am, всего редактировалось 1 раз.


When I try to connect to a local mysql database using it’s remote ip-address I get a access denied. When I try to connect to that same database from an external machine, it works without any problems. When I connect to the local database using localhost, it works perfectly as well. E.g., if the database server has the ip 1.2.3.4 then I get the following results:

# From the db server
mysql -u username -h localhost -p #works perfectly
mysql -u username -h 127.0.0.1 -p #works perfectly
mysql -u username -h 1.2.3.4 -p #Access denied

# From any other machine
mysql -u username -h 1.2.3.4 -p #works perfectly

What can I do to allow local access to my database using its remote ip-address? The OS of the database server is Fedora 15 and the MySQL version is 5.5.23.

asked Oct 23, 2012 at 14:03

Tiddo's user avatar

TiddoTiddo

6,3096 gold badges51 silver badges85 bronze badges

3

Try to edit/add bind-address = 0.0.0.0 to your [mysqld] section of your /etc/mysql/mysql.conf.d/mysqld.cnf file and restart MySQL Service.

answered Jun 29, 2018 at 18:01

Eduardo Cuomo's user avatar

Eduardo CuomoEduardo Cuomo

17.6k6 gold badges115 silver badges93 bronze badges

5

I found the solution to my problem myself, but I still don’t quite understand why it didn’t work:

I granted privileges to that user on the hosts % and localhost:

# Before
+-----------------+------------+
| Host            | User       |
+-----------------+------------+
| %               | username   |
| localhost       | username   |
+-----------------+------------+

With these settings I got the results I showed above. When I granted privileges to that user on host it suddenly did work.

# After
+-----------------+------------+
| Host            | User       |
+-----------------+------------+
| %               | username   |
| localhost       | username   |
| <myIpAddress>   | username   |
+-----------------+------------+

Apparently % does work for remote connections, but not for local connections.

answered Oct 23, 2012 at 15:00

Tiddo's user avatar

TiddoTiddo

6,3096 gold badges51 silver badges85 bronze badges

1

This particular issue can be caused by host name resolution.

I have resolved it in my particular case by deleting this variable from my my.cnf config file:

skip-name-resolve

Either remark the variable by placing a pound sign # or just delete it from your my.cnf after making sure you back it up, of course.

Eduardo Cuomo's user avatar

answered Sep 5, 2013 at 16:01

Victor F.'s user avatar

  • Home
  • Help
  • Installation & Maintenance
  • Matomo On-Premise (self-hosted)
  • Troubleshoot Database

The MySQL server error SQLSTATE[HY000] [2002] Connection refused. can be caused by several reasons, if you follow the steps below you should be able to fix this issue:

  • Check that your config file config/config.ini.php (in the Matomo directory) contains the correct and up to date DB credentials under the [database] section. Check that the DB username, DB password, database host, and database port are correct. (if you are unsure, reach out to your database administrator or check in your web hosting account for the up to date credentials).
  • If the config file references host = "localhost", you can try to change it to 127.0.0.1 instead, for example in your config.ini.php under [database] set host = "127.0.0.1".
  • If the above changes do not resolve the issue, we recommend you try to connect to MySQL on the command line to check if the credentials are correct and the server works. Connect to the server running Matomo and run this command: mysql -h [hostname] -u [username] -p[password] -D [dbname] (and replace the parameters in [] by the values found in your config.ini.php file.).
  • If the command above works, but you still get the “Connection refused” error in the browser, there may be an issue with PHP. Please reach out to your web hosting company or system administrator.
  • Check that the MySQL Server is running. Connect to the server running the MySQL database and check if the MySQL server is actively running by running this command mysqladmin -u root -p status (which should return an output like this: Uptime: 172505 Threads: 2 Questions: 90 Slow queries: 0 Opens: 157 Flush tables: 3 Open tables: 76)
  • If you find the DB server is not running, proceed to restart Mysql server (or rebooting the whole server).
  • Or If the Database server have run out of disk space and there is no space left on the server, it may also start to refuse connections.
  • Sometimes MySQL servers are configured to refused some connections (for example connections from outside the network). If your MySQL database is managed by your web hosting company, contact them as they may be able to help.

If you still have the SQLSTATE[HY000] [2002] Connection refused. after checking the steps above, feel free to reach out to us by clicking the feedback button below.

Previous FAQ: How do I fix the error “Mysql Server has gone away”?

gitarillo, Забыл отписаться. Это была моя ошибка, все таки неверно указал логин и имя базы.

Но вчера появилась ещё одна проблема, связанная с MySQL. Надеюсь, админы не изобьют меня, если я отпишусь о ней в этой же теме.

Мне выдает часто MySql server has gone away (2006). База состоит из одной таблицы, таблица максимум состояла из 12 строк (3 поля в каждой). Запросы использую простейшие:

PHP
1
$result = $pdo->query("SELECT COUNT(*) FROM words");
PHP
1
2
$result = $pdo->prepare("INSERT INTO words (word) VALUES (?)");
$result->execute(array($word));

и далее в таком же роде.

Это моя проблема или проблема хостинга? Да, забыл сказать, что в скрипте использую механизм long polling (то есть, присутствует бесконечный цикл — постоянно принимаются и обрабатываются запросы). Возможно, из за этого?

Понравилась статья? Поделить с друзьями:
  • Ошибка подключения к kalkancryptcom dll класс не зарегистрирован
  • Ошибка подключения к exchange 2010
  • Ошибка подключения к cyberline racing онлайн услугам
  • Ошибка подключения к com порту
  • Ошибка подключения к ch341 not found