Welcome

首页 / 数据库 / MySQL / mysql基础笔记

mysql基础笔记2016-09-16 csdn博客 a9106261、mysql的安装图解。

2、不同数据库的区别对程序的影响

1)数据类型

2)分页的问题

sql的分页相当简单,不同数据库的分页是不同的。sql server也比较简单,只有oracle比较难一些。

3)数据库的自动递增字段

3、mysql的日期处理

4、连上java连上mysql验证实例:

import java.sql.*;public class testmysqlconnection {/** * @param args */public static void main(String[] args) {Connection conn = null;Statement stmt = null;ResultSet rs = null;try {Class.forName("com.mysql.jdbc.Driver");conn = DriverManager.getConnection("jdbc:mysql://localhost/mstx?user=root&password=123456");stmt = conn.createStatement();rs = stmt.executeQuery("select * from mstx_head");while (rs.next()) {System.out.println(rs.getString("tname"));}} catch (ClassNotFoundException e) {e.printStackTrace();} catch (SQLException ex) {System.out.println("SQLException:" + ex.getMessage());System.out.println("SQLState:" + ex.getSQLState());System.out.println("VendorError:" + ex.getErrorCode());} finally {try {if (rs != null) {rs.close();rs = null;}if (stmt != null) {stmt.close();stmt = null;}if (conn != null) {conn.close();conn = null;}} catch (SQLException e) {e.printStackTrace();}}}}
5、英文文档,个人害怕,不敢动造成的。找例子程序

6、show databases、show tables;

注意:

在建表之前,必须要在前边加上use ---;

URL:http://www.bianceng.cn/database/MySQL/201609/50447.htm