-- 修改密码
UPDATE mysql.user set authentication_string =PASSWORD('Emm~!2020@mysql') WHERE user = 'root' and host = '%';
FLUSH PRIVILEGES;
SELECT Host, User, plugin from user;
-- 新建用户对应赋权查看不同的表
INSERT INTO mysql.user(Host, User, authentication_string, ssl_cipher, x509_issuer, x509_subject) VALUES ('%', 'contract', PASSWORD('Emm~!2023@contract'), '', '', '');
INSERT INTO mysql.user(Host, User, authentication_string, ssl_cipher, x509_issuer, x509_subject) VALUES ('%', 'sonar', PASSWORD('Emm~!2023@sonar'), '', '', '');
INSERT INTO mysql.user(Host, User, authentication_string, ssl_cipher, x509_issuer, x509_subject) VALUES ('%', 'devops', PASSWORD('Emm~!2023@devops'), '', '', '');
INSERT INTO mysql.user(Host, User, authentication_string, ssl_cipher, x509_issuer, x509_subject) VALUES ('%', 'esign', PASSWORD('Emm~!2023@esign'), '', '', '');
grant all privileges on sonar.* to sonar@'%' identified by 'Emm~!2023@sonar';
grant all privileges on devops.* to devops@'%' identified by 'Emm~!2023@devops';
grant all privileges on wlfw_contract.* to contract@'%' identified by 'Emm~!2023@contract';
grant all privileges on esign6_docs.* to esign@'%' identified by 'Emm~!2023@esign';
grant all privileges on esign6_evidence.* to esign@'%' identified by 'Emm~!2023@esign';
grant all privileges on esign6_file_system.* to esign@'%' identified by 'Emm~!2023@esign';
grant all privileges on esign6_manage.* to esign@'%' identified by 'Emm~!2023@esign';
grant all privileges on esign6_nacos.* to esign@'%' identified by 'Emm~!2023@esign';
grant all privileges on esign6_seals.* to esign@'%' identified by 'Emm~!2023@esign';
grant all privileges on esign6_signs.* to esign@'%' identified by 'Emm~!2023@esign';
grant all privileges on esign6_unified_portal.* to esign@'%' identified by 'Emm~!2023@esign';
FLUSH PRIVILEGES;
接下来是Oracle的
-- Oracle 新建用户和授权表空间
create user rxcx identified by "Cnpc2023@rxcx";
create user db_material identified by "Cnpc2023@db_material";
create user db_nacos identified by "Cnpc2023@db_nacos";
create user klyc identified by "Cnpc2023@klyc";
create tablespace rxcx datafile '/opt/oracle/oradata/SCNPCLTP122/rxcx.dbf' size 20m;
alter user rxcx default tablespace rxcx;
grant create session,create table,unlimited tablespace to rxcx;