Wordpress, Joomla can't connect to database after install MariaDB10

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
VictorQ
New here
Posts: 7
Joined: Wed May 22, 2019 10:06 am

Wordpress, Joomla can't connect to database after install MariaDB10

Post by VictorQ »

Hello

I would like start my website on Joomla 4.0.5, thats why I have to install MariaDB10. Had few problems with installation, but I found here some solution and now can connect to phpMyAdmin. Ver Serv: 10.5.8-MariaDB-log - MariaDB Server , ver php:7.3.7.
I create database for Joomla and start Joomla, but get error: "Could not connect to database: No such file or directory. Also try Wordpress but get error too: "Error establishing a database connection". Wordpress work before with database on MariaDB5 without any problems.

I'm install MariaDB10 from Qnap App centre.

I'm stuck now and I don't know how too connect database to Web. Please Help.


-------------------
Qnap TS 453A
8GB RAM
QTS5.0.0.1891


Regards
User avatar
dolbyman
Guru
Posts: 35005
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by dolbyman »

You have a VM / container capable NAS ...use those for website hosting if you HAVE to do that on the NAS

joomla is a preferred target for massive automated attacks, so if your website gets hacked..your NAS can be compromised too (webserver runs as root)

side effect is, you can install all the latest tools inside the virtual environment
VictorQ
New here
Posts: 7
Joined: Wed May 22, 2019 10:06 am

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by VictorQ »

I'm not familiar with VM and container. Can You give me some idea/advice, please
User avatar
dolbyman
Guru
Posts: 35005
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by dolbyman »

User avatar
Toxic17
Ask me anything
Posts: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by Toxic17 »

are you connecting to the db on the right port? The QNAP MariaDB 10 seems to default to 3307 and not the older port db default of 3306.
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
VictorQ
New here
Posts: 7
Joined: Wed May 22, 2019 10:06 am

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by VictorQ »

Toxic17 wrote: Sun Jan 16, 2022 6:46 am are you connecting to the db on the right port? The QNAP MariaDB 10 seems to default to 3307 and not the older port db default of 3306.
Yes I know port its 3307. I add in config.inc.php (phpMyAdmin) lines:

port: $cfg['Servers'][$i]['port'] = '3307';
socket: $cfg['Servers'][$i]['socket'] = '/var/run/mariadb10.sock';

I can open phpMyAdmin and login, add database and name. Just problem is when I start install wordpress or joomla then get notice:

"Error establishing a database connection, This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down"

I have correct password, user, table name but system don't see my database. On MariaDB5 all working fine.
VictorQ
New here
Posts: 7
Joined: Wed May 22, 2019 10:06 am

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by VictorQ »

dolbyman wrote: Sat Jan 15, 2022 11:29 pm You have a VM / container capable NAS ...use those for website hosting if you HAVE to do that on the NAS

joomla is a preferred target for massive automated attacks, so if your website gets hacked..your NAS can be compromised too (webserver runs as root)

side effect is, you can install all the latest tools inside the virtual environment
I install VM and download Ubuntu Server, but it's looks like this will be take lots of resources, is it? And I think this is only temporary solution? I prefer do this without VM.
User avatar
dolbyman
Guru
Posts: 35005
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by dolbyman »

why would this be temporary?

I run nextcloud on one of my NAS like this..works fine..permanent
lousyfool
Getting the hang of things
Posts: 74
Joined: Tue Apr 20, 2021 1:45 pm

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by lousyfool »

Append the port to the host name, like e.g. "db.myhost.com:3307".
jimmacmillan
New here
Posts: 2
Joined: Fri Mar 19, 2021 11:11 pm

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by jimmacmillan »

Hi VictorQ,

Did you ever figure things out? I've been getting the same message in WordPress. I was about to give up then thought I'd try one more thing. Instead of "localhost" I used "127.0.0.1:3307" and everything started working.

Outside of that WP has having problem getting updates. I'm sure there's something similar in Joomla but here's how I fixed it.
Add the following line: "define( 'FS_METHOD', 'direct' );" to the functions.php file.

Like you I didn't want to get into containers or VM's. I'm so relieved that I didn't give up. Oh, I also setup the Virtual host in QNAP. Now I have my local host file resolving a to a domain name. Life is good again :DD

Jim
wgdejonge
Starting out
Posts: 22
Joined: Sat Aug 22, 2009 3:22 pm

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by wgdejonge »

jimmacmillan wrote: Sun Jul 24, 2022 1:14 pm Hi VictorQ,

Did you ever figure things out? I've been getting the same message in WordPress. I was about to give up then thought I'd try one more thing. Instead of "localhost" I used "127.0.0.1:3307" and everything started working.
Exactly what I was looking for while trying to restore my joomla website with Akeeba backup. Thanks!
Anderer
New here
Posts: 7
Joined: Sat Jan 05, 2019 5:39 am

Re: Wordpress, Joomla can't connect to database after install MariaDB10

Post by Anderer »

jimmacmillan wrote: Sun Jul 24, 2022 1:14 pm Instead of "localhost" I used "127.0.0.1:3307" and everything started working.
Hi Jim,

THANK YOU SO MUCH for posting. This solved the issue of long time struggle.

I installed Nextcloud 24 @ QNAP and could not connect with MariaDB 10, even that Apache 8.1, MariaDB 10 and phpMyAdmin were working properly. Also the Nextcloud setup with SQLite worked well, but just the connection to MariaDB was not possible aaaand

"127.0.0.1:3307" instead of "localhost" is the solution to the previous error message:

Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory

Regards,

Rico
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”