Config php ini file

Hi all. Seems I need to configure xampp MySQL ini file. I know server is localhost. It seems I have no privileges to add a new user to my database and when i click manage db in php it connects to a different IP address and logs me into a different database. Any ideas it wreaking my brain.

Has someone just replied to my query. If so I got a desktop notification but cannot see message in my inbox or on thread

I don’t understand what you mean?
You use manage database on 000webhost to create database and username etc?

Hi yes I have created 1 in webhost and localhost (no privileges) but I have also worked with a PHP db in Joomla for another site. I installed xampp and the default config file of Xampp for MYSQL logs me into the 2nd db on an IP address

See the part about xampp I’m not understanding?

Xampp uses an IP address of via TCP/IP
Whereas Webhost uses Server: Localhost via UNIX socket instead of IP and SSL is not being used. Apparently I need SSL running so that I can grant myself some permissions too but one problem at a time. Thanks for getting back to me.

I am still away with it today I think?

the details for database on our server is localhost and the database, username and password are configurable via our panel.

Our plan doesn’t allow remote MySQL

I’m just not 100% what you mean when you mention xampp.
We provide PHPmyadmin online for managing your database with us.

ok so can you tell me how I add new user to webhost database as I have no privileges and cannot see a users tab or privileges tab to make any changes. Thanks

So open our panel and manage database or MySQL database and create a database and it will ask for username and password.
Once created you can open PHP my admin and run queries etc.
You can’t change privileges or anything like that on the free system you just get all basically

That is no good at all. There isn’t any point in creating another db and adding myself as a user to get the same connection problem that I already have. Can I ask you why i cannot connect to the php db by adding my username, password and dbname to the sql as this is my problem
$conn = new PDO(“mysql:host=$servername;dbname=dustbusterz”, $username, $password);

$conn = new PDO(“mysql:host=$servername;dbname=dustbusterz”, $username, $password);

So host= localhost
db name = the one displayed under 000webhost panel i.e. id123456_dbname
username = the one displayed under 000webhost panel i.e. id123456_username
and the password picked again on our panel.

Please expand exactly what you mean.

Hi Infinity. Thank u 4 ur time again. I think i have spotted the problem. I have negated the Id numbers in my statement. So i only entered the name not id123456_dbname and the same for userID. Could I ask what is the direct IP address of webhost so I can enter that instead of localhost and I will rectify my code and try again.

@TinMan There is no ip(this feature is available only on premium plans), you need use localhost as the host address.

Remember if use localhost as host locally on your PC, then it will connect to your local database on your PC. If you want to use 000webhost related database then you need to upload your files online with same host as localhost.

Yes i have connected successfully but I have an Appache webpage that has taken over my homepage. I cannot find out why or how to get my site back. Can you help with that?

That occurs rarely.
First if you have content plz backup, then go to general >> settings >> Hit Reset Website.
This will fix your issue.

Before you reset if you post your URL we can check to see why the Apache page is appearing it is normally a bad htaccess or something like that

resetting the website fixxed my errors thank you.

1 Like