MySQL
EthanQ
这个作者很懒,什么都没留下…
展开
-
mysql的几个小技巧
1.修改mysql中root的密码:shell>mysql -u root -pmysql>SET PASSWORD FOR root=PASSWORD("root");2.远程登录mysql server:(当然server必须首先给某个远程用户授权了)shell>mysql -h host -u user -p3.打开数据库:use dbname;显示所有数据库转载 2012-01-16 20:57:16 · 412 阅读 · 0 评论 -
MySQL 设置cascade on delete on update
Here's what you'd include in your components table.CREATE TABLE `components` ( `id` int(10) unsigned NOT NULL auto_increment, `typeId` int(10) unsigned NOT NULL, `moreInfo` VARCHAR(32),转载 2012-03-08 14:18:03 · 4910 阅读 · 0 评论 -
Result consisted of more than one row
执行存储过程, 报错: Result consisted of more than one row 检查后发现: 某条SQL语句 select ... into from tableName where ... 查询的结果有多条记录导致. 只要在这条语句后加一个限制即可: select ... into from tableName where ... limit原创 2012-04-02 14:53:46 · 913 阅读 · 0 评论 -
mysql 查看存储过程
查询数据库中的存储过程 方法一: select `name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE' 方法二: show procedure status; 查看存储过程或函数的创建代码原创 2012-04-02 14:16:13 · 689 阅读 · 0 评论