Gossamer Forum
Home : General : Perl Programming :

new mysql database with .sql file

Quote Reply
new mysql database with .sql file
Hi, I have a .sql file that is supposed to make it easy for me to create a new mysql database. I am a little unsure of how to use it though. I log into mysql from telnet and type:

mysql> /home/screamingv/public_html/gnutella_php4/gs_mysql.sql

I figured this would go ahead and create the database for me. Instead, it prints this on the screen:

->

And is prompting me for some kind of input. Afraid to go on, I just close telnet at this point. What should I do to complete the creation of the database?

Thanks, Ryan



Quote Reply
Re: new mysql database with .sql file In reply to
What we do is to open a telnet session login to the mysql database server and just paste in the contents from the sql file right into our telnet window and then the mysql server accepts all the statements in the sql file and creates the database tables for us.

Harrison


"I've got if's pretty good, but that's about it"
Quote Reply
Re: new mysql database with .sql file In reply to
That gives an error when I paste at the ->: ERROR 1046: No Database Selected

Any ideas for me? Here is the source of the .sql file:

# phpMyAdmin MySQL-Dump
# http://phpwizard.net/phpMyAdmin/
#
# Host: localhost Database : gnutella

# --------------------------------------------------------
#
# Table structure for table 'search_results'
#

DROP TABLE IF EXISTS search_results;
CREATE TABLE search_results (
search_id int(11) NOT NULL,
hosts int(11) NOT NULL,
files int(11) NOT NULL,
messages int(11) NOT NULL,
PRIMARY KEY (search_id)
);


# --------------------------------------------------------
#
# Table structure for table 'search_words'
#

DROP TABLE IF EXISTS search_words;
CREATE TABLE search_words (
search_id int(11) NOT NULL,
word varchar(100) NOT NULL,
KEY search_id (search_id),
KEY word (word)
);


# --------------------------------------------------------
#
# Table structure for table 'searches'
#

DROP TABLE IF EXISTS searches;
CREATE TABLE searches (
search_id int(11) NOT NULL auto_increment,
search_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
ip varchar(16) NOT NULL,
host varchar(100) NOT NULL,
timeout int(11) NOT NULL,
PRIMARY KEY (search_id)
);

Quote Reply
Re: new mysql database with .sql file In reply to
In Reply To:
And is prompting me for some kind of input. Afraid to go on, I just close telnet at this point. What should I do to complete the creation of the database?
Yes, the ; that was missing from the line above. Smile

--mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.
Quote Reply
Re: new mysql database with .sql file In reply to
In Reply To:
That gives an error when I paste at the ->: ERROR 1046: No Database Selected

Any ideas for me? Here is the source of the .sql file:
You probably need to 'use YourDatabaseName;' before you call that scripts. If you aren't currently in a database, it can't manipulate tables in it.

--mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.
Quote Reply
Re: new mysql database with .sql file In reply to
Thanks for the responses Harrison and Mark!

I played around and fiured it out. The script in .sql didn't work because I never created the 'gnutella' database. I thought the script would... bad assumption! Anyone with similar problems should read http://perl.about.com/...k=r4&terms=mysql.

Ryan