MySQL Ìí¼ÓÍâ¼ü
MySQL Ìí¼ÓÍâ¼ü
DROP TABLE IF EXISTS `nation`;
CREATE TABLE `nation`(
`pii_Nation` smallint(2) unsigned NOT NULL default '0',
`pii_NatinoName` varchar(40) NOT NULL default '',
PRIMARY KEY (`pii_Nation`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `userinfo`;
CREATE TABLE `userinfo` (
`ID` char(18) NOT NULL default '',
`Name` varchar(20) NOT NULL default '',
`Sex` varchar(2) NOT NULL default 'ÄÐ',
`pii_Nation` smallint(2) unsigned NOT NULL default '0',
PRIMARY KEY (`ID`),
FOREIGN KEY (`pii_Nation`) references nation(`pii_Nation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Ïà¹ØÎĵµ£º
×î³õµÄjbpm.hibernate.cfg.xmlÖУ¬¶ÔMySQLµÄ·½ÑÔÅäÖóÉÁËorg.hibernate.dialect.MySQLDialect£¬·¢²¼Á÷³ÌµÄʱºòÓöµ½ÏÂÊö´íÎó£º
Cannot delete or update a parent row: a foreign key constraint fails
Could not synchronize database state with session
½«MySQL·½ÑÔÐÞ¸ÄΪorg.hibernate.dialect.MySQLInnoDBDialectÎÊ ......
Why you should ignore MySQL’s key cache hit ratio
http://www.mysqlperformanceblog.com/2010/02/28/why-you-should-ignore-mysqls-key-cache-hit-ratio/
²»ÒªÏàÐÅmysqlµÄkey cache hit ratio£º
key cache hit ratio = 1 - key_reads / key_read_requests
key_reads:´Ó´ÅÅÌÖжÁ¿éµÄÊýÁ¿
key_read_request ......
½ñÌìÓöµ½Òªµ¼³öÊý¾Ý¿âÖбíµÄÊý¾Ý¡£ÏÂÃæÕâ¸ö¾Í¿ÉÒԸ㶨¡£¡£
#µ¼³öÖ¸¶¨µÄ±í #µ¼³öÃüÁî -uÓû§Ãû -pÃÜÂë -hÖ÷»úIPµØÖ· Êý¾Ý¿âÃû ±íÃû1 ±íÃû2 > µ¼³öÎļþ.sql
mysqldump -uroot -proot -h192.168.0.88 ok_db oktable1 oktable2 > ok_db.sql
ÁíÍâÔÚ¸ü¸ÄmysqlÃÜÂëʱºò£¬ÍøÉÏÓÐЩÃüÁî²»¶Ô£º
ÎÒÓÃÈçÏ£ºset password=pas ......
package com.lovo.cq.shopping10_1.common;
import java.sql.*;
public class DbUtil {
private PreparedStatement pstmt = null;
private Connection con = null;
public DbUtil() {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://l ......
1.µÇ¼£º mysql -uroot -p
2.LinuxÏÂmysql ²»ÄÜÍâÍø·ÃÎÊ
ÒѾÔÚMYSQLÀïgrantÁËȨÏÞÁË¡£ÔÚÍâÍø»¹ÊDz»ÄÜ·ÃÎÊ .
ÎÊÌ⣺
cat /etc/mysql/my.conf
ÕÒµ½ÏÂÃæÒ»ÐÐ
bind-address = 127.0.0.1
Î ......