How to import data from .sql file in mysql?

Viewed 42

I have a 2.6GB file which I need to import and I used the command

sudo mysql -u root -p <dbname> > ~/<filename>.sql I created a database from phpmyadmin and ran the above command.

It has been running for 30 minutes and when I run SHOW PROCESSLIST; on a separate window I get this

mysql> SHOW PROCESSLIST;
+-----+------+-----------+------+---------+------+-------+------------------+
| Id  | User | Host      | db   | Command | Time | State | Info             |
+-----+------+-----------+------+---------+------+-------+------------------+
| 149 | root | localhost | test | Sleep   | 1716 |       | NULL             |
| 155 | root | localhost | NULL | Query   |    0 | init  | SHOW PROCESSLIST |
+-----+------+-----------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

What is happening and why is it gone to sleep? How do I solve this? It turns out that mysql server in preferences keeps shutting down whenever I start it. How do I solve this?

0 Answers
Related