eclipse里导入导出数据库

 时间:2024-10-13 11:38:56

1、导入:在mysql命令行里创建相应的库名 create database bcunews; use bcunews; scource D:/bcunews.sql(数据库所在位置);

2、导入成功

3、导出:进入mysql安装路径,假设 d:\mysql\bin打开cmds输入: cd: d:\mysql\bin mysqldump -u root -p bcunews>e:/b.sql(想要导出的位置)最后输入mysql密码

4、导出成功

5、连接数据库的一段程序(有数据库的用户名和密码)public class connDB { Connection conn=null; public Connection getConnection(){ String url="jdbc:mysql://localhost/bcunews"; String user="用户名"; String password="密码"; try { Class.forName("com.mysql.jdbc.Driver"); conn=DriverManager.getConnection(url,user,password); return conn; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } }

  • 数据库er图怎么画
  • 如何将pycharm界面设置成白色
  • 类图怎么画?
  • Navicat 如何导出数据
  • 用word画E-R图,怎么画?
  • 热门搜索
    僵尸世界大战攻略 云南旅游攻略自由行路线推荐 老中医减肥茶 麦田里的守望者简介 奥特曼格斗进化0攻略 怎么祛眼袋 郑多燕减肥操下载 晚餐吃什么能减肥 张大千简介 田老师红烧肉官网