My PHP program tells me it can't access the database and gives an error message ?

MySQL - When you create a new database you have to specify a database name. Then you create a user by entering a username and password.

For best results keep your database name, database username, and database password at no fewer than 6 and no more than 7 letters or numbers.

You must add this new user to your new database.

In your script, your database name and your database username must be prefaced by your hosting account username_.  Your password, however, stands alone.

For example: If your hosting account username is "mrcertified", your database name is "testdb", your database username is "dbuser", and your database password is "passwd1977", here is how you need to put them in your script:

database server should be :   localhost
database name should be written as mrcertified_testdb

database username should be written as mrcertified_dbuser
database password should be written simply as passwd1977

آیا این پاسخ به شما کمک کرد؟

 پرینت این مقاله

در همین زمینه

Fatal PHP Memory Limit Error

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in...

How to reset my Joomla administrator password?

You can reset your Joomla administrator's password through the script's MySQL Database. The most...

How do I connect to MySQL through PHP?

Use the following outline to connect and begin querying the MySQL server from within your PHP...

How to setup custom php.ini file?

What is php.ini?PHP.ini is very important configuration file for PHP that is used to customize...

Wordpress theme installation issue?

I recently installed a few new themes to my wordpress site and i can see the colors and fonts,...