SQL 存储过程自动发送邮件,提示:profile name is not valid

本文介绍了解决在使用EXECmsdb.dbo.sp_send_dbmail过程中遇到的'e-flow机'名称没有权限的问题,通过增加权限实现了正常发送邮件。

 EXEC msdb.dbo.sp_send_dbmail
  @profile_name = 'e-flow机',
  @recipients =
'jeremy.yuan@163.com',
  @subject = '月邮件提示',
  @body =  '',
  @body_format = 'HTML';

 

出现错误的原因是‘e-flow机’这个名称没有权限,需要给他增加权限

在springboot项目中配置多数据源,配置文件如下所示: spring: data: cassandra: local-datacenter: datacenter1 profiles: active: mysql grpc: server: port: 9091 system: max-user-limit: 10 management: endpoints: web: exposure: include: metrics # ==================== MySQL 配置 ==================== --- spring: config: activate: on-profile: mysql datasource: url: jdbc:mysql://localhost:3306/springbootdemo?useSSL=false&serverTimezone=UTC&characterEncoding=utf8 username: root password: 159357 driver-class-name: com.mysql.cj.jdbc.Driver jpa: show-sql: true hibernate: ddl-auto: update properties: hibernate: dialect: org.hibernate.dialect.MySQL8Dialect format_sql: true jdbc: lob: non_contextual_creation: true # ==================== Cassandra 配置 ==================== --- spring: config: activate: on-profile: cassandra # 激活cassandra profile时使用此配置 data: cassandra: keyspace-name: my_database local-datacenter: datacenter1 contact-points: localhost port: 9042 # 默认Cassandra端口 compression: none schema-action: CREATE_IF_NOT_EXISTS connection: connect-timeout: 10s init-query-timeout: 10s autoconfigure: exclude: - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration # 排除JDBC自动配置 - org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration # 排除JPA自动配置 # ==================== MongoDB 配置 ==================== --- spring: config: activate: on-profile: mongodb data: mongodb: host: localhost port: 27017 database: my_database 切换了数据源后启动项目报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraUserRepository' defined in com.tplink.nbu.demo.basicspringboot.repository.CassandraUserRepository defined in @EnableCassandraRepositories declared on BasicSpringBootApplication: Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession' defined in class path resource [org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.oss.driver.api.core.CqlSession]: Factory method 'cassandraSession' threw exception; nested exception is com.datastax.oss.driver.api.core.AllNodesFailedException: Could not reach any contact point, make sure you've provided valid addresses (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/127.0.0.1:9042, hostId=null, hashCode=1db8c4a1): [com.datastax.oss.driver.api.core.connection.ConnectionInitException: [s0|control|connecting...] Protocol initialization request, step 1 (OPTIONS): failed to send request (io.netty.channel.StacklessClosedChannelException)] 原因是什么,如何解决
09-02
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值