Jump to content

Problems with mysql and phpmyadmin


ch4rlie

Recommended Posts

I have a db.php and inside it I filled out all the info needed:

<?php
define('DB_HOST', 'example.com');
define('DB_NAME', 'database_name');
define('DB_USERNAME', 'user_name');
define('DB_PASSWORD', '*******');

$odb = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USERNAME, DB_PASSWORD);
?>

My problem is with the DB_HOST, is that my direct URL to the site? for example, google.com or is it like an IP?

 

Link to comment
https://forums.phpfreaks.com/topic/292929-problems-with-mysql-and-phpmyadmin/
Share on other sites

is that my direct URL to the site

 

 

no. and in the cases where you do specify a url (that resolves to the ip of the database server), it would be the url of the database server, not the url of a web server. typical urls would be something like mysql1.example.com.

 

if you are having a problem on your hosting connecting to the correct database server for you account, you can find the correct hostname to use from your web host and it is also typically displayed on the page (phpmyadmin) where you created your databases/database tables.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.