Web Hosting Talk







View Full Version : Simple MySQL Question...(I think?)...


dgessler
07-31-2001, 04:28 PM
I am trying to install a php script that uses a MySQL database but I have absolutely no experience with MySQL but I really wanted to use this script. I *think* I may have set up the database properly through my CPanel but when I execute the php script (phpAds) I get an error:

Warning: Unknown MySQL Server Host '/usr/bin/mysql' (2) in /home/dgessler/public_html/phpAds/lib.inc.php3 on line 129

IN that file this is how I can configure the variable:

// MySQL hostname
$phpAds_hostname = "localhost";

And I thought all I needed to do was replace localhost to where mysql is but I guess that isnt right, can someone help me and tell me what I shoudl put under "mysql hostname"?

ffeingol
07-31-2001, 04:37 PM
It should prob. just stay "localhost". It's the name of the server (i.e. hostname) where the MySQL server is running. It's normally on the same box as your webserver and therefore referred to as "localhost".

If it's not on the same host, your hosting company will need to provide the host name.

Frank

dgessler
07-31-2001, 04:54 PM
I seem to have fixed the problem now I have another question, I am viewing the .sql file on the web right now and its telling me to create tables, and in my site's control panel their is a utility to ad mysql databases called phpMyAdmin and I entered the table name but I do not know what to to put in the "fields" textbox, this is how one of my tables looks liek in the sql file:

# --------------------------------------------------------
#
# Table structure for table 'adclicks'
#

CREATE TABLE adclicks (
bannerID mediumint(9) DEFAULT '0' NOT NULL,
t_stamp timestamp(14),
host varchar(255) NOT NULL,
KEY clientID (bannerID)
);


# --------------------------------------------------------

Does anybody know if you can tell how many fields there are in that table? Thanks

ffeingol
07-31-2001, 05:17 PM
If you have telnet/ssh access, you can just do it from the shell:

mysql -u USER -p DATABASE < INPUT.SQL

Where:

USER is your user-id
DATABASE is your database name
INPUT.SQL is your input file

If you want to do it via phpMyAdmin, you don't have to create the tables if you have a sql file (and it looks like you do).

Click on your database name in the left hand pane.
Put the file name in the editbox below "or Location of the textfile:"
click "go"

Frank

jnestor
07-31-2001, 05:18 PM
You're probably best off just cutting and pasting that code into a SQL query window. I don't know phpMySql so I can't help you there.

Anyway there are 3 columns in the table in your example: bannerID, t_stamp and host. bannerID is a key with the index name clientID.