Mysql示例库安装方法

Mysql示例库安装方法
下载示例库:
https://dev.mysql.com/doc/index-other.html
在这里插入图片描述
在这里插入图片描述
下载完成后上传到服务器的任意目录,在此示例目录为:
根目录下的/software文件夹。
进入目录后解压缩:
#cd /software/
#unzip test_db-master.zip
解压后会得到一个test_db-master目录,进入该目录
#cd test_db-master
执行导入:
#mysql -h localhost -t <employees.sql -u root -p
输入root用户密码:
注意:如果在导入语句中输入数据库用户密码,会提示
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database ‘employees.sql’

导入完后登录到数据库验证:
#mysql -uroot -p
输入root密码:
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| db_mysql |
| employees |
| information_schema |
| mysql |
| performance_schema |
| sys |
±-------------------+
6 rows in set (0.06 sec)
看到employees库已创建完成,进入employees数据库查看表。
mysql> use employees;
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> show tables;
±---------------------+
| Tables_in_employees |
±---------------------+
| current_dept_emp |
| departments |
| dept_emp |
| dept_emp_latest_date |
| dept_manager |
| employees |
| salaries |
| titles |
±---------------------+
8 rows in set (0.00 sec)

至此,完成实例库的安装。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值