简体   繁体   中英

Can't create my database using ssh php mysql

Hey guys I'm having a little trouble getting my database to actually create.

my professor provided us with a .data file containing all of the queries that need to run to create the tables and insert the data into them. I run the following line of code:

mysql -u user -p pass >use dbname.data

but then when I try to query the database or do anything to it it tells me that there aren't any tables in the database. I have also tried the following with no luck:

mysql -u user -p pass >create dbname.data
mysql -u user -p pass >create database dbname.data

Can someone please point me in the right direction here? I'm running out of time and my professor is literally no help!

thanks in advance.

EDIT:

I ran the following and it ran a bunch of queries saying "Query ok, 1 row affected"

use databasename;
source dbfilename.data

but now when I run these:

use databasename;
show tables;

it says "empty set"

Try this

mysql -u user -p pass dbname < file.data

检查.data文件是否存在“ USE databasename”查询,并且数据库名称与您期望的名称相同。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM