Web Hosting Talk







View Full Version : Argh...Newbie with MySQL


Radon3k
06-24-2002, 06:04 AM
I'm a newbie with MySQL and I'm trying to import a database for a vBulletin board.

The vBulletin manual says that to restore a database you need to type "mysql -uUsername -p password < /path/to/file/"

Well what does "<" mean and how do you get it to work?

I've tried typing that in while in shell and it doesn't work.

Also, can you do this from phpMyAdmin? For some reason I can't get the mysql command to work in shell.

Thanks for any help! :)

roly
06-24-2002, 06:09 AM
Yes you can use phpMyAdmin but you need at least 2.2.4

Radon3k
06-24-2002, 06:10 AM
Ok but how do I use that command? I typed in < /path/to/file/ in phpMyAdmin but it didn't work...

What do I have to type in to get it to work?

roly
06-24-2002, 06:16 AM
Originally posted by Radon3k
Ok but how do I use that command? I typed in < /path/to/file/ in phpMyAdmin but it didn't work...

What do I have to type in to get it to work?
lol phpmyadmin is in pure php, its a php script
install it from www.phpmyadmin.net
click on the db
and copy or upload the mysql schema into where it says.

Radon3k
06-24-2002, 06:18 AM
Um...I know what it is, but I need to import a file called vbulletin.sql

I tried upping it but it said "no query found"...I did open up vbulletin.sql but it's so big I can't and don't have the time to copy and paste bits of it at a time. Is there another way to upload it?

Lawrence
06-24-2002, 06:32 AM
Originally posted by Radon3k
I'm a newbie with MySQL and I'm trying to import a database for a vBulletin board.

The vBulletin manual says that to restore a database you need to type "mysql -uUsername -p password < /path/to/file/"

Well what does "<" mean and how do you get it to work?


Back to this one, the "<" will use your file (/path/to/file) as input to the command. So in this case, you'd be firing up the MySQL client ("mysql -uUsername -p password") and passing the SQL commands in your file as input, thus rebuilding your database ("< /path/to/file/").

Radon3k
06-24-2002, 06:34 AM
Yes I did that and nothing happens, it tells me it's not a valid querry...

Radon3k
06-24-2002, 06:35 AM
In fact, this is what it tells me:

You have an error in your SQL syntax near '< /usr/local/psa/home/vhosts/domain.com/vbulletin.sql' at line 1

(Of course domain.com is replaced w/ the original)

roly
06-24-2002, 06:35 AM
well upload phpmyadmin to old host where vb board currently is, optimize database then try to upload to new host again

Radon3k
06-24-2002, 06:37 AM
In phpMyAdmin, the "<" command is not working...I do need to type in the name of the backup file that I upped, yes? If so, then I'm doing it right but it wont' work....

roly
06-24-2002, 06:39 AM
umm < isn't for phpmyadmin

Radon3k
06-24-2002, 06:40 AM
Well then what do I use for phpMyAdmin?? And btw, every time I've tried that command it doesn't work either, but that's a different story....

Lawrence
06-24-2002, 06:42 AM
Originally posted by Radon3k
In fact, this is what it tells me:

You have an error in your SQL syntax near '< /usr/local/psa/home/vhosts/domain.com/vbulletin.sql' at line 1

(Of course domain.com is replaced w/ the original)

Is this Windows or Unix that you're using? And if you're using Unix, which shell?

Radon3k
06-24-2002, 06:42 AM
Linux with Plesk

Lawrence
06-24-2002, 06:47 AM
I just checked phpMyAdmin, which is probably easier. Just select your database on the left, and you should get a screen with lots of options for your database. Scroll down to "Run SQL query/queries on database YOURDATABASE". Then there's an option for "Or Location of the textfile". Click the browse button and select the file from your computer to upload and run.

As for the command line, I don't know why "<" isn't working. I thought it was standard for all shells, but maybe I'm wrong. Try typing "bash" first to go to the bash shell, and try the command there. I normally use bash, and it certainly works there.

Radon3k
06-24-2002, 06:48 AM
I did do that browse thing and I selected the vbulletin.sql file and then after about 3 minutes (it's kinda big) it tells me "No SQL Querry!"

Radon3k
06-24-2002, 06:52 AM
As for that bash thing, this is what it tells me when I type in "bash mysql -uusername -p password"

mysql: mysql: No such file or directory

Lawrence
06-24-2002, 07:05 AM
For the bash thing, type "bash" on its own first, and press enter. You should then be taken into the bash shell, assuming that it is installed, and that you aren't already there. Then type in your SQL command.

As for the error with phpMyAdmin... I'm not sure about that one. Sounds as though the file mightn't have uploaded properly though. How big is it?

Radon3k
06-24-2002, 07:11 AM
It's about 7mb big

Radon3k
06-24-2002, 07:12 AM
And I'm guessing that bash isn't installed as it doesn't work properly for me...