MySQL安装与卸载
SQL语句与Oracle大致相同
主要使用 Navicat for MySQL进行数据库操作
MySQL常用的命令:
登录:mysql -uroot -p /mysql -uroot -proot
退出:exit
建库:create database 库名;
卸载库:drop database 库名;
显示所有库:show databases;
选择库:use 库名;
显示选中库的所有表:show tables;
显示表中的内容:describe 表名;
加载驱动类
MySQL:Class.forName("com.mysql.jdbc.Driver");
Oracle:Class.forName("oracle.jdbc.driver.OracleDriver");
连接数据库
MySQL:DriverManager.getConnection("jdbc:mysql://host:prot/database","user", "pwd");
浙公网安备 33010602011771号