首页 > 其他分享 >redash

redash

时间:2022-08-27 20:56:34浏览次数:46  
标签:insert 1981 into values emp null redash

数据图表工具,能根据数据库中的表做折线图等,并发布到网站

1、在www.dazdata.com中下载Redash VMware虚拟机,这是个Ubuntu操作系统,它自带了redash工具,本地用虚拟机打开这个虚拟机

2、在虚拟机里面去链接本地(虚拟机外面)的mysql:sudo mysql -u root -p972597 -h 192.168.79.1,这个是用来测试与本地mysql 能不能连上,-h后面的ip是本地cmd的ipconfig的net1的ip地址

3、sql建个库,表,插入数据:

create DATABASE test

use test

create table emp (

    empno numeric(4) not null,

    ename varchar(10),

    job varchar(9),

    mgr numeric(4),

    hiredate datetime,

    sal numeric(7, 2),

    comm numeric(7, 2),

    deptno numeric(2)

);
insert into emp values (7369, 'SMITH', 'CLERK', 7902, '1980-12-17', 800, null, 20);

insert into emp values (7499, 'ALLEN', 'SALESMAN', 7698, '1981-02-20', 1600, 300, 30);

insert into emp values (7521, 'WARD', 'SALESMAN', 7698, '1981-02-22', 1250, 500, 30);

insert into emp values (7566, 'JONES', 'MANAGER', 7839, '1981-04-02', 2975, null, 20);

insert into emp values (7654, 'MARTIN', 'SALESMAN', 7698, '1981-09-28', 1250, 1400, 30);

insert into emp values (7698, 'BLAKE', 'MANAGER', 7839, '1981-05-01', 2850, null, 30);

insert into emp values (7782, 'CLARK', 'MANAGER', 7839, '1981-06-09', 2450, null, 10);

insert into emp values (7788, 'SCOTT', 'ANALYST', 7566, '1982-12-09', 3000, null, 20);

insert into emp values (7839, 'KING', 'PRESIDENT', null, '1981-11-17', 5000, null, 10);

insert into emp values (7844, 'TURNER', 'SALESMAN', 7698, '1981-09-08', 1500, 0, 30);

insert into emp values (7876, 'ADAMS', 'CLERK', 7788, '1983-01-12', 1100, null, 20);

insert into emp values (7900, 'JAMES', 'CLERK', 7698, '1981-12-03', 950, null, 30);

insert into emp values (7902, 'FORD', 'ANALYST', 7566, '1981-12-03', 3000, null, 20);

insert into emp values (7934, 'MILLER', 'CLERK', 7782, '1982-01-23', 1300, null, 10);

4、打开虚拟机的浏览器,输入localhost:5000,访问 redash 界面,在设置里面新建数据源,把本地的ip,端口等,都填上

5、在查询里面,根据表创建一堆图,然后发布

6、在报表里面,把前面的图加进来,然后发布,就能从网站上访问了

 

标签:insert,1981,into,values,emp,null,redash
From: https://www.cnblogs.com/pjishu/p/16631444.html

相关文章