/*參數:插入記錄的起始ID,客戶ID,記錄數,初始使用者名稱*/DELIMITER $$CREATE PROCEDURE batchInsert(IN init INT , IN cid INT , IN loops INT , IN username VARCHAR(64))BEGINDECLARE myid INT;DECLARE myname VARCHAR(64);DECLARE num INT;SET myid = init;SET myname = username;SET
Enter password: ******Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 57Server version: 6.0.4-alpha-community-log MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>
對於mysql的複製相同表結構方法,有create table as 和create table like 兩種,區別是什麼呢? create table t2 as select * from t1 where 1=2 ; 或者 limit 0;as建立出來的t2表(新表)缺少t1表(源表)的索引資訊,只有表結構相同,沒有索引。 create table t2 like t1 ;like 建立出來的新表包含源表的完整表結構和索引資訊二者的用途:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' 就說說解決辦法吧:root@zby:~# /etc/init.d/mysql restart 是啟動不了了 網上說可能是/var/run/mysqld的許可權的問題,不過,我是通過apt-get install 安裝的,不會出現此問題root@zby:/var/run/mysqld# ll
在公司一直使用Oracle,在家裡了,機器配置太爛,所以打算使用MySql。安裝,建庫,建表,一切都好。可是插入資料時,英文沒有問題,插入中文就報data too long for column 'sName' at row 1上網查了一下原因,原來是字元集的問題,修改辦法為:(1)修改 MySql安裝目錄下面的my.ini(MySQL Server Instance Configuration 檔案)。 設定 default-character-set=gbk(注意,有2處)
好像Tomcat6的資料來源配置比較簡單一些,不過如果按照以前版本的方法設定的話,會出現很多問題如:Name jdbc is not bound in this Context或者 Cannot create JDBC driver of class '' for connect URL 'null'等等我把我用Tomcat6和Mysql5.17配置資料來源的步驟寫出來,大家可以參考一下1.
使用 APACHE COMMON DBCP +COMMON POOL+MYSQL串連無效的問題Throwable occurred: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is
參考 http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html1.下載MYSQL的JDBC驅動 http://mysql.mirror.vmmatrix.net/Downloads/Connector-J/mysql-connector-java-3.1.13.tar.gz 解壓後將裡面的jar檔案拷貝到tomcat的lib中 cd Downloads tar xvzf