superuser

Recover postgres user in PostgreSQL

限于喜欢 提交于 2019-12-11 06:10:41
问题 I need to recover the superuser privilege for the postgres user, because it lost the superuser qualification. I cannot do anything in the psql shell, it gives the message must be superuser to create superusers The system is Ubuntu 16.04 and PostgreSQL 9.5. Can I recover this postgres user? 回答1: If you managed to remove superuser privileges from all your users, you'll have to start the database in single user mode: Stop the database server as operating system user postgres : /path/to

Android Root权限静默安装

时光怂恿深爱的人放手 提交于 2019-12-07 03:55:53
说明:用于简单记录。 1. 请求root权限,root权限静默安装 请求root 1 // 请求root权限,用这个请求root权限,等待授权管理返回 2 public static boolean upgradeRootPermission2(String pkgCodePath) { 3 String cmd = " chmod 777 " + pkgCodePath; 4 Process process = null ; 5 DataOutputStream os = null ; 6 BufferedReader br = null ; 7 StringBuilder sb = null ; 8 try { 9 process = Runtime.getRuntime().exec( " su " ); 10 os = new DataOutputStream(process.getOutputStream()); 11 os.writeBytes(cmd + " \n " ); 12 os.writeBytes( " echo return\n " ); 13 os.writeBytes( " exit\n " ); 14 br = new BufferedReader( new InputStreamReader( 15 process.getInputStream()