1 (edited by fausto.94 2020-01-18 21:12:20)

Topic: Can't access Mysql / MariaDB

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx):both
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello, yesterday I successfully installed iredmail on my Ubuntu VPS.
The mail is fine except it always ends in the spam folder.
My problem is:
I want to use the VPS to deploy a Java web application, so I installed Tomcat, then MySql, but I can't install MySql because it gives me an error when I run: sudo mysql_secure_installation.
the error is:

mysql_secure_installation: [ERROR] unknown variable 'default-character-set=utf8mb4'

then it asks me the password for root user and then:

Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Now, I've never used Ubuntu so I'm not that comfortable with these environment, but I understand there's a problem with mysql configuration file because of that socket var not found.
Obviously mysql is not installed, infact iredmail uses MariaDB, so I decided to connect to MariaDB.
I've always used Mysql, so after googling I found the command to access MariaDB.... mysql!
after some attempts I can't connect using mysql -u root:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

So, how can I deploy my Java app if I can't connect to or use MySQL / MariaDB?
Can anyone help me please solving MySQL / MariaDB problem?

if you need some logs, please specify the path because, as I said, I'm not that comfortable with Ubuntu.
Thanks a lot in advance.

EDIT:
now mysql seems completely KO:
DATABASE ERROR: CONNECTION FAILED! (appeared on roundcube)

inside roundcube error log file I can see (multiple times):

postfix/postscreen[25007]: DISCONNECT [185.234.219.66]:62378
postfix/pickup[24240]: 48003y10Gfz7ts1: uid=0 from=<root>
postfix/proxymap[25163]: warning: connect to mysql server 127.0.0.1:3306: Can't connect to MySQL server on '127.0.0.1' (111)
postfix/trivial-rewrite[25164]: warning: proxy:mysql:/etc/postfix/mysql/transport_maps_maillist.cf lookup error for "*"
postfix/trivial-rewrite[25164]: warning: proxy:mysql:/etc/postfix/mysql/transport_maps_maillist.cf lookup error for "*"
postfix/proxymap[25163]: warning: connect to mysql server 127.0.0.1:3306: Can't connect to MySQL server on '127.0.0.1' (111)
postfix/cleanup[25161]: warning: proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf lookup error for "root@MY_DOMAIN"
postfix/cleanup[25161]: warning: 48003y10Gfz7ts1: sender_bcc_maps map lookup problem -- message not accepted, try again later
postfix/pickup[24240]: warning: maildrop/48003y0Y2Lz7tlJ: error writing 48003y10Gfz7ts1: queue file write error
postfix/pickup[24240]: 48003y18wpz7ts1: uid=0 from=<root>
postfix/cleanup[25161]: warning: proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf lookup error for "root@MY_DOMAIN"

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2 (edited by Cthulhu 2020-01-19 02:11:12)

Re: Can't access Mysql / MariaDB

mysql has different authentication options, it seems u have configured the accounts to authenticate via unix_socket, but the account in the mysql.users is set up for plain authentication


If you install iredmail with MariaDB backend, then mysql is already installed, and the users/accounts are configured.
Seems u broke the mysql configuration after u tried to install mysql after it was already installed.

3

Re: Can't access Mysql / MariaDB

Mail server has many daemon services running, it's already complicate for system management. It's better run iRedMail on a separate VPS.