標籤: drop procedure if exists p_hello_world;create procedure p_hello_world()begin declare id integer; declare username varchar(256); declare result varchar(4000) default ‘‘; /* don‘t work */ /*declare cur_user cursor for select id
標籤:安裝的時候遇到密碼問題處理A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !You will find that password in ‘/root/.mysql_secret‘.vi /root/.mysql_secretmysql -uroot -p 隨機密碼 UPDATE user SET Password=PASSWORD(‘‘) where USER=‘root‘; FLUSH
標籤:添加使用者 insert into mysql.user(Host,User,Password) values("%","shenen",password("123456"));添加所有許可權 grant all privileges on fgame.* to ‘shenen222‘@‘%‘ identified by ‘123456‘;特定表添加查詢許可權 grant select on test.phpcms_ios_module to
標籤:問題create table: Specified key was too long; max key length is 767 bytes 原因資料庫表採用utf8編碼,其中varchar(255)的column進行了唯一鍵索引而mysql預設情況下單個列的索引不能超過767位(不同版本可能存在差異) 於是utf8字元編碼下,255*3 byte 超過限制 解決1 使用innodb引擎;2
標籤:DELIMITER &&CREATE PROCEDURE syncAdvertiser() BEGIN DECLARE id bigint; DECLARE _cur CURSOR FOR SELECT id from advertisers; OPEN _cur; REPEAT FETCH _cur INTO id; SQL UNTIL 1>0 END REPEAT; CLOSE _cur;
標籤:如需要讓192.168.2.3的test使用者可以訪問本機所有資料庫,mysql命令如下 mysql>GRANT ALL PRIVILEGES ON *.* TO ‘test’@’192.168.2.3′ IDENTIFIEDBY ‘123456’;mysql>flush privileges;grant文法說明 grant 許可權名(所有的許可權用all) on 庫名(*全部).表名(*全部) to