如何导入cookbook数据到MySQL

参考: GitHub - svetasmirnova/mysqlcookbook

建库:

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> CREATE DATABASE cookbook;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| carrefour          |
| cookbook           |
| information_schema |
| menagerie          |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
7 rows in set (0.00 sec)

mysql> 

Guide:

[root@MaxwellDBA backup]# ls -ltt
total 16428
-rw-r--r-- 1 root root 16813610 Oct 13 14:18 cookbook.sql
-rw-r--r-- 1 root root     4794 Oct 13 11:03 carrefour_dump.sql
[root@MaxwellDBA backup]# pwd
/var/lib/mysql/backup
[root@MaxwellDBA backup]# mysql -u root -p cookbook < cookbook.sql
Enter password: 
[root@MaxwellDBA backup]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 100
Server version: 8.0.26 Source distribution

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| carrefour          |
| cookbook           |
| information_schema |
| menagerie          |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
7 rows in set (0.00 sec)

mysql> use cookbook
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> 
mysql> show tables;
+-----------------------+
| Tables_in_cookbook    |
+-----------------------+
| actors                |
| adcount               |
| al_winner             |
| app_log               |
| artist                |
| book_authors          |
| book_vendor           |
| booksales             |
| catalog_list          |
| cd                    |
| city                  |
| color                 |
| cow_color             |
| cow_order             |
| date_val              |
| datetbl               |
| datetime_val          |
| die                   |
| doremi                |
| drawing               |
| driver_log            |
| expt                  |
| formula1              |
| goods_characteristics |
| goods_shops           |
| groceries             |
| groceries_order_items |
| hitcount              |
| hitlog                |
| hostip                |
| hostname              |
| housewares            |
| housewares2           |
| housewares3           |
| housewares4           |
| httpdlog              |
| httpdlog2             |
| hw_category           |
| image                 |
| ingredient            |
| insect                |
| inv_item              |
| invoice               |
| item                  |
| limbs                 |
| mail                  |
| marathon              |
| mark_log              |
| metal                 |
| money                 |
| movies                |
| movies_actors         |
| movies_actors_link    |
| name                  |
| news                  |
| newsstaff             |
| numbers               |
| obs                   |
| occasion              |
| painting              |
| passtbl               |
| passwd                |
| patients              |
| perl_session          |
| person                |
| php_session           |
| phrase                |
| player_stats          |
| player_stats2         |
| poi                   |
| poll_vote             |
| profile               |
| profile_contact       |
| rainfall              |
| rand_names            |
| rank                  |
| ranks                 |
| reviews               |
| roster                |
| ruby_session          |
| sales_region          |
| sales_tax_rate        |
| sales_volume          |
| sibling               |
| standings1            |
| standings2            |
| states                |
| str_val               |
| sundays               |
| testscore             |
| testscore_withmisses  |
| testscore_withmisses2 |
| time_val              |
| tmp                   |
| tomcat_role           |
| tomcat_session        |
| tomcat_user           |
| top_names             |
| trip_leg              |
| trip_log              |
| tsdemo                |
| weatherdata           |
| weekday               |
+-----------------------+
103 rows in set (0.00 sec)

mysql> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值