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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.