准备一张表create database dbtest; use dbtest; drop table if exists user; create table user( id int not null primary key auto_increment, name varchar(20) );编写存储过程delimiter // create procedure fill_talbe(in count int) begin set @int:1; while @init <= count do insert into user values(null, concat("user-", @init)) set @init = @init + 1; end while; end // delimiter ;调用存储过程drop procedure if exists fill_table; call fill_table(1000000);其他delimiter 是个创建函数、存储过程、触发器的基本框架套路delimite
1.下载并安装 mysql5.7 的 yum 源wget http://repo.mysql.com//mysql57-community-release-el6-8.noarch.rpm rpm -ivh mysql57-community-release-el6-8.noarch.rpm2.yum 安装 mysql5.7yum install -y mysql-community-server3.第二步如果遇到报错信息:Error:Unable to find a match: mysql-community-server,使用以下方式解决(禁用本地 mysql 模块后再安装):yum module disable mysql yum -y install mysql-community-server4.如果第三步遇到报错信息: Error: Problem: cannot install the best candidate for the job,解决方案如下:vim /etc/yum.repos.d/mysql-community.repo5.打开后,找到 [mysql57
Minghui
却道天凉好个秋!
CC BY-NC-SA 4.0