易截截图软件、单文件、免安装、纯绿色、仅160KB

JDBC连接MySQL数据库关键的四个步骤

JDBC连接MySQL数据库关键的四个步骤 http://www.mesfr.com
一、查找驱动程序
  MySQL目前提供的Java驱动程序为Connection/J,可以从MySQL官方网站下载,并找到mysql-connector-java-3.0.15-ga-bin.jar文件,此驱动程序为纯Java驱动程序,JDBC链接MySQL不需做其他配置。
二、动态指定classpath
  如果需要执行时动态指定classpath,就在执行时采用-cp方式。否则将上面的.jar文件加入到classpath环境变量中。
三、加载JDBC 连接MySQL   
  
try{  
 Class.forName(com.mysql.jdbc.Driver);  
 System.out.println(Success loading Mysql Driver!);  
}catch(Exception e)  
{  
 System.out.println(Error loading Mysql Driver!);  
 e.printStackTrace();  
}   
 
四、设置JDBC连接MySQL的URL4、设置JDBC连接MySQL的URL
    
      jdbc:mysql://localhost/databasename[?pa=va][&pa=va] 


相关文档:

Linux 编译安装 MYSQL 5.1 与 Innodb

Linux 编译安装 MYSQL 5.1 与 Innodb
编译mysql5
代码:
./configure \
--prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--with-extra-charsets=all \
--with-charset=utf8 \
- ......

php学习笔记(13):PHP+MYSQL简单分页

conn.php
<?php
/*
 * Created on 2010-1-6
 * Author:CHAUVET
 * Function:连接字符串
 */
 $conn=@mysql_connect("localhost","root","")or die("连接数据库出错!");
 mysql_select_db("newdb",$conn);
 mysql_query("set names 'gb2312'");
 function ReplaceSom ......

Mysql开启日志

原文转自:http://hi.baidu.com/jackli00/blog/item/21b2e242025bfa1473f05d24.html
Mysql开启日志
2008-11-18 11:23
是否启用了日志
mysql>show variables like 'log_bin';
怎样知道当前的日志
mysql> show master status;
看二进制日志文件用mysqlbinlog
shell>mysqlbinlog mail-bin.000001(要写绝对问题 ......

Backup and Restore MySQL Database Using mysqldump


Backup and Restore MySQL Database Using mysqldump
by Ramesh Natarajan on September 22, 2008ShareThis
[mysqldump - MySQL Backup & Restore]mysqldump is an effective tool to backup MySQL database. It creates a *.sql file with DROP table, CREATE table and INSERT into sql-statements of the source ......

Mysql数据备份以及异地存储

整理tuscany.org.cn的服务器,发现3年前写的脚本还在跑着 :)
脚本如下:
#==========================================================
#!/bin/bash
current_date=`date +%Y-%m-%d:%H:%M:%S`
/usr/local/mysql/bin/mysqldump -prootpass  dbname1 > ./DB_DIR/dbname1_"$current_date"_dump_file.sql 
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号