简体   繁体   English

在ubuntu服务器上将sql文件导入mysql失败

[英]Importing a sql file to mysql on an ubuntu server failing

I'm trying to import a sql file that is on the server using the following command in the terminal 我正在尝试使用终端中的以下命令导入服务器上的sql文件

mysql -u NAME -p DBNAME < path/to/FILE.sql

when i do that it asks for the password, after inputting the password nothing happens. 当我这样做时,它要求输入密码,输入密码后什么也没有发生。 I check the database and no tables have been added. 我检查数据库,未添加任何表。

Note: 注意:

  • DBNAME is created in the mysql database. DBNAME是在mysql数据库中创建的。

  • I have also tried the following syntax in mysql and also that didn't work 我也在mysql中尝试了以下语法,但也没有用

mysql> source PATH/TO/FILE.sql

Please Help :D 请帮助:D

The sql file was corrupt, all i had to do was delete it and upload it once again. sql文件已损坏,我要做的就是删除它,然后再次上传。 thanks @CBroe 谢谢@CBroe

Hello you can trying with 您好,您可以尝试

  1. Create the database for import the tables: 创建数据库以导入表:

    mysql -u root -p mysql -u root -p

    create database database_name; 创建数据库database_name;

    exit 出口

    mysql -u user -p databasename < databasename.sql mysql -u用户-p databasename <databasename.sql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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