Web Hosting Talk







View Full Version : Another MySQL Question


certify
07-25-2001, 11:41 AM
# You may create the tables indicated by the SQL commands displayed
# below by executing the following single command on your MySQL
# database server (assuming that 'username' has access to the
# database 'databasename' on SQL server 'hostname'):
#
# mysql --host='hostname' --user='username'
# --password 'databasename' < initialize_tables.txt
#
# note: --password means server will prompt for your password,
# and no single quotes are intended to appear on the command
# line (these were just used to delimit the fields you'll need
# to supply actual values for).


Anybody know what this means??

mysql --host='hostname' --user='username'
--password 'databasename' < initialize_tables.txt

eva2000
07-25-2001, 12:24 PM
it's the command to import items in initialize_tables.txt into a database named 'databasename' which is located on a host name 'hostname' :)

more simply put if you have a database named without quotes 'vbdatabase' and you have a file you need imported called 'tables.sql'

you would need to import them

with the command

mysql -u mysqlusername -p mysqlpassword vbdatabase < /path/to/tables.sql

it's actually best to run the command without the mysqlpassword on the same line like

mysql -u mysqlusername -p vbdatabase < /path/to/tables.sql

when you hit enter it will prompt your for your mysqlpassword

Nice intro to mysql -> http://www.mysql.com/articles/mysql_intro.html

certify
07-25-2001, 12:48 PM
Thanks eva2000. :)

You are my saviour. :)