记一次 pgsql 数据库连接数超出,导致服务无法正常访问的问题
show max_connections;
select usename, count(*) from pg_stat_activity group by usename order by count(*) desc;
SELECT count(*) FROM pg_stat_activity WHERE NOT pid=pg_backend_pid();
SELECT count(*) FROM pg_stat_activity;
SELECT * from pg_stat_activity;
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE state='idle'
MySQL/MariaDb 开启远程连接(解决:Host xxx is not allowed to connect to this MariaDb server)
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
use mysql;
update user set host='%' where user='root' and host='localhost';
select host, user from user;
FLUSH RIVILEGES;