|
CREATE DATABASE IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS `userinfo`;
CREATE TABLE `userinfo` (
`AutoId` int(4) NOT NULL auto_increment,
`UserName` varchar(20) NOT NULL,
`UserPswd` varchar(20) NOT NULL,
PRIMARY KEY (`AutoId`),
KEY `UserName` (`UserName`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `userinfo` (`AutoId`,`UserName`,`UserPswd`) VALUES
(1,'zgmaike','7910525');
DROP PROCEDURE IF EXISTS `UserInfo`;
DELIMITER $$
CREATE DEFINER=`zgmaike`@`%` PROCEDURE `UserInfo`(IN ID INT)
BEGIN
SELECT * FROM UserInfo WHERE AutoId = ID;
END $$
DELIMITER ;
DROP VIEW IF EXISTS `username`;
CREATE ALGORITHM=UNDEFINED DEFINER=`zgmaike`@`%` SQL SECURITY DEFINER VIEW `username` AS select `userinfo`.`AutoId` AS `AutoId`,`userinfo`.`UserName` AS `UserName` from `userinfo`;
我有2.6版本中试了不行的,在哪儿个版本中可以?如果不行,管理远程MySql一般用哪个工具? |
|