How to connect with MySQL

Both the popular PDO and MySQLi libraries are available on all accounts and PHP versions, which are the libraries all (modern) scripts use to connect to a MySQL database. However, to use a database, you need to configure a few things first.

Before you can use a database, you need to create the database first. You can create a database through your control panel in the section called MySQL Databases. Simply enter a desired name in the text box and click Create Database.

To use the database with your script, you’ll need to know your database name, username, password and hostname. Almost all of those details are listed under Current Databases in the MySQL Databases section. The only parameter not listed there is the password you use to login to your control panel and FTP. If you don’t remember that password, you can reset it through your client area.

Note that many scripts prefill the database hostname field with “localhost” or even hide it completely. Using “localhost” will not work, you have to use the MySQL hostname exactly as it’s listed under your Current Databases.

Finally, please note that it’s NOT possible to connect to the free hosting databases from outside the hosting platform. This means you cannot access the database from desktop or mobile applications directly, or use them in applications hosted elsewhere.

2 Likes

Hi,
Sorry could you explain more in detail this?

My website is wordpress softacoulus installation, works good but I just created a database, in mysql db doesn’t appear the wordpress one normally
Today the loading of the website was saying unsecure connection and noticing servers issues… .Maybe for what you wrote… Is occurring an overwrite of files that can run online and not… The health state was advising of a migration scheduled job troubled…
And the cached section on supercache test has found 2 different address…

ALMOST ALL WHAT’S UP IF I DELETE THE NEW DATABASE?

AND IF I RENAME THE WORDPRESS “DEFAULT” ONE ?

What part is not clear?

If you’re having problems with your website, please create a new topic in Hosting Support about it. Also, the “unsecure connection” issue is related to HTTPS on your site, not the database.

4 Likes