# PHPMyAdmin Connection

**URL:** <https://forum.infinityfree.com/t/phpmyadmin-connection/85818>\
**Category:** Hosting Support\
**Created:** [November 6, 2023, 6:36pm UTC](https://forum.infinityfree.com/t/phpmyadmin-connection/85818 "2023-11-06T18:36:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon91589454](https://forum.infinityfree.com/letter_avatar/anon91589454/32/6_449c533f586939b6e5f246632a46421f.png) [@anon91589454](https://forum.infinityfree.com/u/anon91589454)\
**Post date:** [November 6, 2023, 6:36pm UTC](https://forum.infinityfree.com/t/phpmyadmin-connection/85818/1 "2023-11-06T18:36:59Z")

</div>

Hello!

So I’m recently new to infinityfree and I don’t understand how to connect my php code to the MySQL database.

If you know how to do it please reply 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [November 6, 2023, 6:40pm UTC](https://forum.infinityfree.com/t/phpmyadmin-connection/85818/2 "2023-11-06T18:40:58Z")

</div>

Knowledgebase to the rescue!

> [@How to connect with MySQL](https://forum.infinityfree.com/t/how-to-connect-with-mysql/49340):
>
> 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…

The PDO library (I recommend this one)

[https://www.php.net/manual/en/book.pdo.php](https://www.php.net/manual/en/book.pdo.php)

---

<div class="post-metadata">

**Author:** ![anon91589454](https://forum.infinityfree.com/letter_avatar/anon91589454/32/6_449c533f586939b6e5f246632a46421f.png) [@anon91589454](https://forum.infinityfree.com/u/anon91589454)\
**Post date:** [November 6, 2023, 6:53pm UTC](https://forum.infinityfree.com/t/phpmyadmin-connection/85818/3 "2023-11-06T18:53:25Z")

</div>

Hey!  
Thanks for the response, but I want to say that I already have a working code from my localhost, I just can’t find out on how to connect the MySQL, since I have never worked with MySQL on a host program!

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [November 6, 2023, 11:40pm UTC](https://forum.infinityfree.com/t/phpmyadmin-connection/85818/5 "2023-11-06T23:40:11Z")

</div>

> [@anon91589454](#):
>
> but I want to say that I already have a working code from my localhost

Then just replace your localhost credentials with your production ones (From IF). You can find them in the client area.

Also, make sure to specify a database table name, it is required on free hosting.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [November 21, 2023, 11:40pm UTC](https://forum.infinityfree.com/t/phpmyadmin-connection/85818/6 "2023-11-21T23:40:57Z")

</div>

Closed on November 21, 2023, 11:40pm UTC

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
