Joomla 4 cannot connect to the database Topic is solved

Need help installing Joomla! 4.x? For all Joomla! 4.x installation issues please use this forum.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
johnhardy
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Jan 10, 2015 2:13 pm

Joomla 4 cannot connect to the database

Post by johnhardy » Tue Jan 24, 2023 5:37 pm

Hello,
I downloaded my new Joomla 4.26 and have tried to install this for a new installation.

I get to the end of the input fields and get the message,
Could not connect to the database Access denied for user 'my username'@'localhost' (using password: YES)
Should I be using the password instead of the username?
Thank you

John
Last edited by toivo on Tue Jan 24, 2023 11:57 pm, edited 1 time in total.
Reason: mod note: retitled

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4963
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Joomla 4

Post by gws » Tue Jan 24, 2023 6:42 pm

You need a user name and a password unless you are hosting on your own pc.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42364
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla 4

Post by Webdongle » Tue Jan 24, 2023 7:26 pm

If you are Hosting on your PC with wamp or similar then:
* The installation with create a database to the name you define in the database name field.
* The Host is ... localhost
* Database username ... root
* Database username password ... is left blank

If you are installing on a remote Host:
* You need to set up the database
* Set up a database user and password (unless the remote Host provides default ones).
* Fill in the fields in the installation according to your remote Host requirements.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 8330
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Joomla 4

Post by AMurray » Tue Jan 24, 2023 9:24 pm

Your database user and password are so the application can access the database. The details are those specified when you create the database in your webhosting account. (Ask your webhost about creating databases, or refer to their documentation).

The installation documentation instructs you to create a database. It's the second thing listed after checking your hosting meets the minimum technical requirements. (https://docs.joomla.org/J4.x:Installing_Joomla). Refer also to https://docs.joomla.org/J4.x:Hosting_Setup and https://docs.joomla.org/Special:MyLangu ... for_Joomla!
Regards - A Murray

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42364
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla 4

Post by Webdongle » Tue Jan 24, 2023 9:56 pm

AMurray wrote:
Tue Jan 24, 2023 9:24 pm
...
The installation documentation instructs you to create a database. ...
On localhost Joomla's installation script will (usually) create the database
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

johnhardy
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Jan 10, 2015 2:13 pm

Re: Joomla 4 cannot connect to the database

Post by johnhardy » Wed Jan 25, 2023 10:12 am

Thank you for your excellent help.
I am using localhost on my own PC.
I am using xampp
I created a database and am using root with no password.
Regards

John

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42364
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla 4 cannot connect to the database

Post by Webdongle » Wed Jan 25, 2023 3:19 pm

When the php version, of the xampp you are using becomes out of date ... you might consider wamp
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

johnhardy
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Jan 10, 2015 2:13 pm

Re: Joomla 4 cannot connect to the database

Post by johnhardy » Wed Jan 25, 2023 5:27 pm

I am not familiar with wamp.
Can I run both?

johnhardy
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Jan 10, 2015 2:13 pm

Re: Joomla 4 cannot connect to the database

Post by johnhardy » Wed Jan 25, 2023 5:43 pm

I just discovered weblinks thanks for that.
The following is a simulation of my entries which may demonstrate my error(s)
The right side column are similar to the names used in the failed install entry form. Perhaps someone can see where I may be going wrong.
Thank you
John

Enter the name of your Joomla Site mysite1
Enter the real name of your Super User. * Joe Smith
Set the username for your Super User account. * joesmith
Set the password for your Super User account. * 123456xyzokjM
Enter the email address of the website Super User. * [email protected]

Setup Database connection
Database Configuration
Select the database type. * MySQLi
Enter the host name, usually "localhost" or a name provided by your host. * Localhost
Either a username you created or a username provided by your host. * joesmith
Either a password you created or a password provided by your host. 1066andall
Enter the database name. * mydbase
Enter a table prefix or use the randomly generated one. * msi_
Connection Encryption * Default (server controlled)

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42364
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla 4 cannot connect to the database

Post by Webdongle » Wed Jan 25, 2023 7:08 pm

johnhardy wrote:
Wed Jan 25, 2023 5:27 pm
I am not familiar with wamp.
Can I run both?
You can have both on your PC but you can only run one at a time.

* Wamp is installed just like any program on your PC https://www.wampserver.com/en/
* A folder is created in c:\your_wamp_folder\www for your site
* You can have many folders in c:\your_wamp_folder\www
* The virtualhost is reached in your browser localhost/foldername
* Wamp has the option of changing the php and/or database version on the fly. Just click the wamp tray icon hover over php (or database) and selrct the version you want running
* Newer versions of php and database can be added at a click of a button. Download the php and/or database version from https://wampserver.aviatechno.net/. Then right click and run as administrator to add it to your wamp.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

johnhardy
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Jan 10, 2015 2:13 pm

Re: Joomla 4 cannot connect to the database

Post by johnhardy » Thu Jan 26, 2023 11:13 am

I wondered if anyone could see my error in the entry above at Wed Jan 25, 2023 5:43 pm
Thank you

John

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42364
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla 4 cannot connect to the database

Post by Webdongle » Thu Jan 26, 2023 12:21 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

johnhardy
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Jan 10, 2015 2:13 pm

Re: Joomla 4 cannot connect to the database

Post by johnhardy » Fri Jan 27, 2023 10:19 am

Many thanks Web Dongle,

Your right " Database username password is left blank"

I shall remember"

John


Post Reply

Return to “Installation Joomla! 4.x”