localhost address

Problems with the Windows version of XAMPP, questions, comments, and anything related.

localhost address

Postby hughstl » 07. January 2019 14:46

I've installed xampp and got Apache and MySQL running, created a database in phpMyAdmin. All good.

When I call my script's setup file it asks for the database connection details.... but adding 'localhost' for the server just gets a red "Database Connection Error" flag.

???

What is the correct address for the server?

Thanks
Hugh
hughstl
 
Posts: 9
Joined: 07. January 2019 14:29
XAMPP version: 5.6.39
Operating System: Windows 10 Home

Re: localhost address

Postby Altrea » 07. January 2019 17:44

Hi,

If you did not change anything localhost is correct or 127.0.0.1.
If you changed the Mysql default port you need to tell your script the new port too.
And you need to use a valid credential combination (user root without a password by default)

Best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9568
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: localhost address

Postby hughstl » 07. January 2019 18:52

Hi Altrea, thanks for reply.

No, I didn't change anything - I just installed XAMPP, created a database via the phpMyAdmin, opened browser and called my script...which opens a 'setup' page with fields to enter database connection info.

First field is server name, so entered 'localhost' - immediately flagged up as database connection error, even before I got to the user/password fields! I'd post a screenshot but can't attach image, it seems.

Hugh
hughstl
 
Posts: 9
Joined: 07. January 2019 14:29
XAMPP version: 5.6.39
Operating System: Windows 10 Home

Re: localhost address

Postby Altrea » 07. January 2019 18:57

Uploading files is disabled here but you can use one of many one click image hostes and include the image url here.
But it seems to be an application issue. Phpmyadmin itself connects to the database too by localhost, root and without a password.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9568
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: localhost address

Postby hughstl » 07. January 2019 19:18

It's an older version of an application, and I think it's looking for MySQL. From what I can tell from the php.ini (and I've very limited knowledge!) PHP7 seems to support MySQLi and MySQLND

Might have to roll back to an earlier version of PHP, perhaps?...
hughstl
 
Posts: 9
Joined: 07. January 2019 14:29
XAMPP version: 5.6.39
Operating System: Windows 10 Home

Re: localhost address

Postby Altrea » 07. January 2019 19:26

I don't know. I don't know your application and it's requirements.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9568
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: localhost address

Postby hughstl » 07. January 2019 19:41

Well nor do I for that matter! It's an older version (5.12) of Appgini, CRUD generator.

The author has advised: "AppGini 5.12 used an older library for connecting to mysql .. this library was removed from more recent versions of PHP".... and ...."try opening the php.ini file in a text editor and search for a line containing “php_mysql” .. if this line is commented, try uncommenting it and restarting Apache. Support for mysql might be there in your installed PHP version but not enabled."

Might have to dig around for an older PHP version - not sure what libraries come with XAMPP or whether there's an easy 'button' to click to initiate older version?...
hughstl
 
Posts: 9
Joined: 07. January 2019 14:29
XAMPP version: 5.6.39
Operating System: Windows 10 Home

Re: localhost address

Postby Altrea » 07. January 2019 19:58

Yes, this old Mysql API was removed since PHP 7.0, so you would need a PHP version 5.6.X or older.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9568
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: localhost address

Postby hughstl » 07. January 2019 20:18

Is there a way to switch to an older version of PHP without having to write code into files? Can I throw a switch somewhere?
hughstl
 
Posts: 9
Joined: 07. January 2019 14:29
XAMPP version: 5.6.39
Operating System: Windows 10 Home

Re: localhost address

Postby Altrea » 07. January 2019 21:23

No. The easiest way is uninstalling XAMPP completely and reinstalling an older xampp version.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9568
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: localhost address

Postby Nobbie » 07. January 2019 21:28

hughstl wrote:Is there a way to switch to an older version of PHP without having to write code into files? Can I throw a switch somewhere?


No, not a switch. But you can download and install the Xampp Version 5.x from the Download site, this comes with MySQL-API. De-install your current Xampp before.
Nobbie
 
Posts: 10797
Joined: 09. March 2008 13:04

Re: localhost address

Postby hughstl » 07. January 2019 22:53

Thanks, guys, I'll remove the install and download the 5 version.

cheers
hughstl
 
Posts: 9
Joined: 07. January 2019 14:29
XAMPP version: 5.6.39
Operating System: Windows 10 Home

Re: localhost address

Postby hughstl » 15. January 2019 00:04

Finally got around to replacing with an older XAMPP distro - 5.6.39 to be precise. Installed ok, opened the control panel, raised phpMyAdmin and created a db, imported sql into db...all went swimmingly. Moved all the site files into htdocs.

Finally called the site... localhost/muludb

Nothing. Except error message: "Error:Access denied for user 'root'@localhost (using password:YES)"

So, still stumped! Any ideas?
hughstl
 
Posts: 9
Joined: 07. January 2019 14:29
XAMPP version: 5.6.39
Operating System: Windows 10 Home

Re: localhost address

Postby Altrea » 15. January 2019 06:30

The default installation does not have a password for MariaDB user root.
But your application seems to expect one.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9568
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: localhost address

Postby Nobbie » 15. January 2019 12:50

The application "muludb" obviously uses "root" plus a password in order to connect to MySQL, but Xampp comes with "root" and WITHOUT password. You have to change that in "muludb".
Nobbie
 
Posts: 10797
Joined: 09. March 2008 13:04

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 75 guests