Problems with connection to the database

1

I have an error that could not connect to the database on line 125 in the file that I will leave here .

Well, they gave me a website for the hand but I do not understand anything about you that in the file above comes.

I have to connect (for testing) the host: localhost; username: root; database: know; and do not have a password (I do not know if this data is accurate to you but I'll stick to it)

Can anyone tell me what's wrong?

PS: I'm very new to the PHP and DB     

asked by anonymous 26.06.2015 / 18:54

1 answer

0
host: localhost

Indicates that the SQL server is on the same server as your site. So if you're running a local test on your machine, you will not find the server. Make sure the code is running on the same database server.

username:root

I'm wondering if the database is MySQL, where the default username is root and no password (password). In this case it may be that someone has changed or created the password for the root user. Look for some MySQL-Front-type tool that lets you connect to the database to find out if the connection data is OK.

    
26.06.2015 / 19:52