mysql下的分页存储过程
CREATE PROCEDURE pro_page(
in _sql varchar(1000),
in _order varchar(1000),
in _pagecurrent int,
in _pagesize int
)
BEGIN
if _pagesize<=1 then
set _pagesize=20;
end if;
if _pagecurrent < 1 then
set _pagecurrent = 1;
end if;
set @strsql = concat(_sql,' ',_order,' limit ',_pagecurrent*_pagesize-_pagesize,',',_pagesize);
prepare stmtsql from @strsql;
execute stmtsql;
deallocate prepare stmtsql;
END;
相关文档:
先用root登陆mysql -u root -p
mysql>show databases;
mysql>use mysql;
update user set password=password('你想设置的密码')
where user='root'; ......
/**********************by garcon1986***************************************/
错误代码如下:
#1045 - Access denied for user 'root'@'localhost' (using password: YES)
$cd /etc/mysql
$mysql -u root -p
出现错误#1045
尝试了很多方法后,在网络上找到了解决方法。
$cd /etc/mysql
$gedit debian.cnf
找到 ......
E:\databases\MySQL\MySQL Server 5.1\bin>mysqldump --help
mysqldump Ver 10.13 Distrib 5.1.30, for Win32 (ia32)
By Igor Romanenko, Monty, Jani & Sinisa
This software comes with ABSOLUTELY NO WARRANTY. This is free softwa
and you are welcome to modify and redistribute it under the GPL ......
先下载一个mysql的驱动器:(我下的是mysql-connector-java-3.1.11-bin.jar)
将它放到java\lib目录下
在环境变量的CLASSPATH里添加该类(%JAV_HOMG%\lib\mysql-connector-java-3.1.11-bin.jar)
出测试该段代码即可:
import java.net.URL;
import java.sql.*;
public class sqlTest {
public static void mai ......
(1)INFORMATION_SCHEMA
select (sum(data_length) + sum(index_length))/(1024*1024) from INFORMATION_SCHEMA.`TABLES` where table_schema = 'your_table_schema' and table_name like 'your_table_name';
(2)show table status like '';
try {
Class.forName("com.mysql.jdbc.Driver");
......