Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

0 votes
1 answers
343 views
Unknown source of high number of connections
In MySQL/Aurora I see from time to time a spike in connections number (from about 100 to 4000): [![enter image description here][1]][1] MySQL [doc][2] says: > Connections > > The number of connection attempts (successful or not) to the MySQL server. So I was thinking those coming from failed connect...
In MySQL/Aurora I see from time to time a spike in connections number (from about 100 to 4000): enter image description here MySQL doc says: > Connections > > The number of connection attempts (successful or not) to the MySQL server. So I was thinking those coming from failed connection, however I don't see failures: MySQL [(none)]> SHOW GLOBAL STATUS like 'Conn%'; +-----------------------------------+----------+ | Variable_name | Value | +-----------------------------------+----------+ | Connection_errors_accept | 0 | | Connection_errors_internal | 0 | | Connection_errors_max_connections | 0 | | Connection_errors_peer_address | 0 | | Connection_errors_select | 0 | | Connection_errors_tcpwrap | 0 | | Connections | 34388970 | +-----------------------------------+----------+ 7 rows in set (0.00 sec) MySQL [(none)]> show global variables like '%conn%'; +-----------------------------------------------+-------------------+ | Variable_name | Value | +-----------------------------------------------+-------------------+ | aurora_max_connections_limit | 16000 | | connect_timeout | 10 | | disconnect_on_expired_password | ON | | init_connect | | | max_connect_errors | 100 | | max_connections | 4000 | | max_user_connections | 0 | | performance_schema_session_connect_attrs_size | 512 | +-----------------------------------------------+-------------------+ I would very much like to understand what those are and when they are coming from.
Nir (529 rep)
Oct 4, 2020, 08:45 AM • Last activity: Aug 4, 2025, 03:10 AM
0 votes
1 answers
2387 views
Database ExecuteSQL(MySQL client run out of memory)
I've an online game the game server execute more than 1M queries [ SELECT , REPLACE , UPDATE ] every 10 sec the problem the memory usage still increasing i dun know why ?? i mean if we suppose that memory usage at the moment is 2000M and it increases to 3000M when the game server execute the queries...
I've an online game the game server execute more than 1M queries [ SELECT , REPLACE , UPDATE ] every 10 sec the problem the memory usage still increasing i dun know why ?? i mean if we suppose that memory usage at the moment is 2000M and it increases to 3000M when the game server execute the queries . why don't the memory usage back again to 2000M or around value after excuting ??? .. it stills increasing and increasing This Problem Makes The Following Error Occur 2016-7-14 16:17:52 -- ERROR: Database ExecuteSQL(MySQL client run out of memory) occur mysql error(SELECT * FROM cq_tutor WHERE tutor_id = 16090848 AND Betrayal_flag = 0). 2016-7-14 16:17:52 -- ERROR: Database ExecuteSQL(Lost connection to MySQL server during query) occur mysql error(SELECT * FROM cq_tutor WHERE Student_id = 16090848 AND Betrayal_flag = 0 LIMIT 1). btw when i restart the game server the memory usage back to 2000M and still increasing too .. I want to know the reason of memory usage increasing i stopped caching of mysql but the same problem occur mysql version is 4.0.17 the client i use is winmysqladmin 1.4 mysql> SHOW VARIABLES; +------------------------------+----------------------------------- | Variable_name | Value | +------------------------------+----------------------------------- | back_log | 50 | basedir | E:\ZFSERVER\MYSQL\ | binlog_cache_size | 32768 | bulk_insert_buffer_size | 8388608 | character_set | latin1 | character_sets | latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5 | | concurrent_insert | ON | connect_timeout | 5 | convert_character_set | | datadir | E:\ZFSERVER\MYSQL\data\ | default_week_format | 0 | delay_key_write | ON | delayed_insert_limit | 100 | delayed_insert_timeout | 300 | delayed_queue_size | 1000 | flush | OFF | flush_time | 1800 | ft_boolean_syntax | + -> SHOW STATUS; +-------------------------+----------+ | Variable_name | Value | +-------------------------+----------+ | Aborted_clients | 36 | | Aborted_connects | 0 | | Bytes_received | 41352179 | | Bytes_sent | 84359720 | | Com_admin_commands | 181 | | Com_alter_table | 2 | | Com_analyze | 0 | | Com_backup_table | 0 | | Com_begin | 0 | | Com_change_db | 64 | | Com_change_master | 0 | | Com_check | 1 | | Com_commit | 0 | | Com_create_db | 0 | | Com_create_function | 0 | | Com_create_index | 0 | | Com_create_table | 252 | | Com_delete | 70 | | Com_delete_multi | 0 | | Com_drop_db | 0 | | Com_drop_function | 0 | | Com_drop_index | 0 | | Com_drop_table | 276 | | Com_flush | 0 | | Com_grant | 0 | | Com_ha_close | 0 | | Com_ha_open | 0 | | Com_ha_read | 0 | | Com_insert | 292241 | | Com_insert_select | 0 | | Com_kill | 0 | | Com_load | 0 | | Com_load_master_data | 0 | | Com_load_master_table | 0 | | Com_lock_tables | 0 | | Com_optimize | 2 | | Com_purge | 0 | | Com_rename_table | 0 | | Com_repair | 9 | | Com_replace | 6 | | Com_replace_select | 0 | | Com_reset | 0 | | Com_restore_table | 0 | | Com_revoke | 0 | | Com_rollback | 0 | | Com_savepoint | 0 | | Com_select | 15736 | | Com_set_option | 12 | | Com_show_binlog_events | 0 | | Com_show_binlogs | 0 | | Com_show_create | 25 | | Com_show_databases | 27 | | Com_show_fields | 2760 | | Com_show_grants | 0 | | Com_show_keys | 9 | | Com_show_logs | 0 | | Com_show_master_status | 0 | | Com_show_new_master | 0 | | Com_show_open_tables | 0 | | Com_show_processlist | 2 | | Com_show_slave_hosts | 0 | | Com_show_slave_status | 0 | | Com_show_status | 1934 | | Com_show_innodb_status | 0 | | Com_show_tables | 57 | | Com_show_variables | 59 | | Com_slave_start | 0 | | Com_slave_stop | 0 | | Com_truncate | 0 | | Com_unlock_tables | 0 | | Com_update | 2138 | | Connections | 207 | | Created_tmp_disk_tables | 0 | | Created_tmp_tables | 0 | | Created_tmp_files | 0 | | Delayed_insert_threads | 0 | | Delayed_writes | 0 | | Delayed_errors | 0 | | Flush_commands | 1 | | Handler_commit | 4 | | Handler_delete | 1 | | Handler_read_first | 3363 | | Handler_read_key | 36141 | | Handler_read_next | 68771 | | Handler_read_prev | 0 | | Handler_read_rnd | 132 | | Handler_read_rnd_next | 3039359 | | Handler_rollback | 63 | | Handler_update | 10 | | Handler_write | 292202 | | Key_blocks_used | 2157 | | Key_read_requests | 459308 | | Key_reads | 352 | | Key_write_requests | 197090 | | Key_writes | 197085 | | Max_used_connections | 24 | | Not_flushed_key_blocks | 0 | | Not_flushed_delayed_rows | 0 | | Open_tables | 0 | | Open_files | 0 | | Open_streams | 0 | | Opened_tables | 1906 | | Questions | 315904 | | Qcache_queries_in_cache | 0 | | Qcache_inserts | 0 | | Qcache_hits | 0 | | Qcache_lowmem_prunes | 0 | | Qcache_not_cached | 0 | | Qcache_free_memory | 0 | | Qcache_free_blocks | 0 | | Qcache_total_blocks | 0 | | Rpl_status | NULL | | Select_full_join | 0 | | Select_full_range_join | 0 | | Select_range | 129 | | Select_range_check | 0 | | Select_scan | 2691 | | Slave_open_temp_tables | 0 | | Slave_running | OFF | | Slow_launch_threads | 0 | | Slow_queries | 0 | | Sort_merge_passes | 0 | | Sort_range | 22 | | Sort_rows | 132 | | Sort_scan | 6 | | Table_locks_immediate | 311455 | | Table_locks_waited | 0 | | Threads_cached | 0 | | Threads_created | 206 | | Threads_connected | 4 | | Threads_running | 1 | | Uptime | 21423 | +-------------------------+----------+ ----------------------------------------------- select che from arenaa where mapid=81513 and status=1 select nameb from arenac where mapid=81529 DELETE FROM arenaa where mapid=81529 select nameb from arenac where mapid=81530 select che from arenaa where mapid=81501 and status=2 REPLACE INTO arenac set mapid=\"81502\",nameb=\"%user_name\" select namea from arenaa where mapid=81505 ------------------------------------------------ -- ---------------------------- -- Table structure for arenaa -- ---------------------------- DROP TABLE IF EXISTS arenaa; CREATE TABLE arenaa ( mapid int(100) NOT NULL default '0', namea varchar(100) NOT NULL default '0', nameb varchar(100) NOT NULL default '0', status int(100) NOT NULL default '0', che int(100) NOT NULL default '1', UNIQUE KEY imapid (mapid) ) TYPE=MyISAM; -- ---------------------------- -- Records of arenaa -- ---------------------------- ############################################# SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for arenac -- ---------------------------- DROP TABLE IF EXISTS arenac; CREATE TABLE arenac ( mapid int(100) NOT NULL default '0', nameb varchar(100) NOT NULL default '0', UNIQUE KEY imapid (mapid) ) TYPE=MyISAM; -- ---------------------------- -- Records of arenac -- ---------------------------- thanks for reading ,,
JORDAN MI (1 rep)
Jul 19, 2016, 01:51 AM • Last activity: Jul 25, 2025, 05:04 AM
1 votes
1 answers
393 views
macos ventura postgres 15 remote connections server closed the connection unexpectedly
macos ventura 13.5.1 postgresql (15.4 (Homebrew)) Remote connections for the server are closed "unexpectedly". I have done all the steps that are needed for postgres to be happy with remote connections on other unix systems, eg: ubuntu. I know that it's seeing the connection attempt since there is a...
macos ventura 13.5.1 postgresql (15.4 (Homebrew)) Remote connections for the server are closed "unexpectedly". I have done all the steps that are needed for postgres to be happy with remote connections on other unix systems, eg: ubuntu. I know that it's seeing the connection attempt since there is a line added in the log at the same time. So it doesn't seem like this is a firewall issue. On that mac. all local connections are happy and the server is working normally. I don't recall ever seeing the **TCP_NODELAY** message on any other installation I have done and googling this issue didn't seem to find meaningful results postgres was installed via:
brew install postgresql@15
connecting to the database like this shows an error:
psql a_database --host an_ip_address --username a_username
psql: error: connection to server at "an_ip_address", port 5432 failed: server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
(
Yes, I know I might want to have a more specific ipaddress eg: 10.0.0.0 but I wanted to make sure I could connect. In pg_hba.conf:
# remote connections with password verification
host    all             all             0.0.0.0/0               md5
In postgresql.conf:
listen_addresses = '*'
In the log for postgres at the time of connection is:
2023-08-25 13:55:02.966 PDT  LOG:  setsockopt(TCP_NODELAY) failed: Invalid argument
boar (13 rep)
Aug 25, 2023, 09:38 PM • Last activity: Jul 23, 2025, 10:07 PM
-3 votes
1 answers
758 views
Connect an desktop application to my SQL Server using internet
I want to connect a desktop app to a SQL Server using internet, not local network. The app will run on every network in the world with internet and the data will retrieve and send from my PC using SQL Server... Do you know how I do that? I have forwarded the TCP 1433 ports in my DLINK router, and al...
I want to connect a desktop app to a SQL Server using internet, not local network. The app will run on every network in the world with internet and the data will retrieve and send from my PC using SQL Server... Do you know how I do that? I have forwarded the TCP 1433 ports in my DLINK router, and allow in the Windows Firewall, I have tried connect with my public IP into the SSMS but the server does not found. Only using my private IP given by my router 192.168.0.XXX.
Allan Ramirez (1 rep)
Jan 9, 2016, 09:19 PM • Last activity: Jul 14, 2025, 01:36 PM
0 votes
1 answers
2523 views
"undefined function pg_pconnect()" when connecting to Postgres from CodeIgniter
I just installed Postgresql and pgadmin in my Ubuntu system. I can create a database from the pgadmin interface and everything seems ok, but when I try to connect to the database from my CodeIgniter application it cannot not connect. It shows an error like: An uncaught Exception was encountered > Ty...
I just installed Postgresql and pgadmin in my Ubuntu system. I can create a database from the pgadmin interface and everything seems ok, but when I try to connect to the database from my CodeIgniter application it cannot not connect. It shows an error like: An uncaught Exception was encountered > Type: Error > > Message: Call to undefined function pg_pconnect() > > Filename: /my codeigniter application > path/system/database/drivers/postgre/postgre_driver.php My database configuration is: $db['postgres_db'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'postgres', 'password' => '1234', 'database' => 'finance', 'dbdriver' => 'postgre', 'dbprefix' => '', 'pconnect' => TRUE, 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE, 'port' => 5432 ); How can I resolve this problem?
jpsai (1 rep)
Jun 28, 2018, 10:13 AM • Last activity: Jun 18, 2025, 09:10 AM
0 votes
0 answers
36 views
SQL Server Connection Failure Due to 233 Error
I'm trying to connect to sqlserver on my own machine but it issues this error sqlserver engine is running ADDITIONAL INFORMATION: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Shared Memory Provider, error: 0 - No pro...
I'm trying to connect to sqlserver on my own machine but it issues this error sqlserver engine is running ADDITIONAL INFORMATION: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233) For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-233-database-engine-error No process is on the other end of the pipe
SajadGeek (1 rep)
Jun 5, 2025, 09:35 AM
0 votes
1 answers
702 views
Why is MySQL not connecting when reading from mylogin.cnf?
On Ubuntu 20.04, I can log into a server by specifying the log credentials on the CLI: ``` $ mysql -h172.30.0.2 -uroot -p bar -e "SELECT id FROM users LIMIT 1;" Enter password: +----+ | id | +----+ | 1 | +----+ ``` However, I cannot log in when using `~/.mylogin.cnf`: ``` $ cat ~/.mylogin.cnf [foo]...
On Ubuntu 20.04, I can log into a server by specifying the log credentials on the CLI:
$ mysql -h172.30.0.2 -uroot -p bar -e "SELECT id FROM users LIMIT 1;"
Enter password:
+----+
| id |
+----+
|  1 |
+----+
However, I cannot log in when using ~/.mylogin.cnf:
$ cat ~/.mylogin.cnf
[foo]
user=root
password="notTheRealPassword"
host=172.30.0.2

$ mysql --login-path=foo bar -e "SELECT id FROM users LIMIT 1;"
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I have confirmed that the file is being read by changing the permissions of the file and noticing MySQL complaining:
$ chmod 660 ~/.mylogin.cnf

$ mysql --login-path=foo bar -e "SELECT id FROM users LIMIT 1;"
mysql: [Warning] /home/dotancohen/.mylogin.cnf should be readable/writable only by current user.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
**Why might MySQL not connect when using ~/.mylogin.cnf?** How should I debug why MySQL is not connecting?
dotancohen (1106 rep)
Oct 24, 2020, 09:01 AM • Last activity: May 28, 2025, 02:06 PM
0 votes
1 answers
236 views
Mysql Connections are string when checking from SHOW STATUS LIKE '%onn%';
I have a Mysql db server which seems to be getting slow by time. When i am checking detail from SHOW STATUS LIKE '%onn%'; I get following details Variable_name Value --------------------------------------------- -------- Aborted_connects 2 Connection_errors_accept 0 Connection_errors_internal 0 Conn...
I have a Mysql db server which seems to be getting slow by time. When i am checking detail from SHOW STATUS LIKE '%onn%'; I get following details Variable_name Value --------------------------------------------- -------- Aborted_connects 2 Connection_errors_accept 0 Connection_errors_internal 0 Connection_errors_max_connections 0 Connection_errors_peer_address 0 Connection_errors_select 0 Connection_errors_tcpwrap 0 Connections 2327 Max_used_connections 7 Performance_schema_session_connect_attrs_lost 0 Ssl_client_connects 0 Ssl_connect_renegotiates 0 Ssl_finished_connects 0 Threads_connected 5 Is there anyway i can get the connections detail of the open connections? Like source ip, username e.t.c. Mysql version is 5.6
Kamran Shahid (111 rep)
Apr 30, 2019, 10:05 AM • Last activity: May 25, 2025, 04:02 PM
1 votes
1 answers
324 views
How to fix mongosh v2.3.3 connection error with AWS DocumentDB v5.0.0
When I try to connect to documentdb cluster version 5.0.0 using mongosh version 2.3.3 it is returned the error message: `MongoServerError: Unsupported mechanism [ -301 ]` I am using the connection string with this format: ```bash mongosh 'mongodb://my_user:my_password@my-host-name.cluster-id-aws.us-...
When I try to connect to documentdb cluster version 5.0.0 using mongosh version 2.3.3 it is returned the error message: MongoServerError: Unsupported mechanism [ -301 ] I am using the connection string with this format:
mongosh 'mongodb://my_user:my_password@my-host-name.cluster-id-aws.us-east-1.docdb.amazonaws.com:27017/my_db_name&tls=true&tlsCAFile=rds-global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false'
I tried to search for a solution at the AWS DocumentDB and MongoDB Community documentations, but I didn't find a fix for this issue.
Emerson Vicente (11 rep)
Nov 5, 2024, 04:03 PM • Last activity: May 23, 2025, 08:05 AM
0 votes
1 answers
27 views
postgres - ok to terminate active connections?
I am wondering whether any really bad things can result from terminating (`pg_terminate_backend()`). Or would this at worst result into current transactions not being roled back. or is current transactions bein rolled back already 'really bad' maybe?
I am wondering whether any really bad things can result from terminating (pg_terminate_backend()). Or would this at worst result into current transactions not being roled back. or is current transactions bein rolled back already 'really bad' maybe?
vrms (269 rep)
May 7, 2025, 07:16 AM • Last activity: May 7, 2025, 07:20 AM
0 votes
1 answers
776 views
ODBC Calling Fill - Unexpected closed connection after 2 hours
Using PostgreSQL 12.3 (Ubuntu 12.3-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit I use driver PostgresSQL Unicode(x64) version 13.00.00.00 I have a query that is executed through an ODBC connection in a Powershell 5.1 script. I use the Fill() meth...
Using PostgreSQL 12.3 (Ubuntu 12.3-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit I use driver PostgresSQL Unicode(x64) version 13.00.00.00 I have a query that is executed through an ODBC connection in a Powershell 5.1 script. I use the Fill() method to retreive about 3500 records daily. When the script works, it takes 2-5 minutes to execute and retrieve data when it works. Problem is that the script "fails" half of the time approx. When this occurs, the Powershell script does stop only after 2h and 30 seconds. We double checked the postgres logs and when this occurs, we see that the query successfully completed within 6 minutes always. I don't know what to look for. any Idea? Below is the error got:
Executed as user: NT Service\SQLSERVERAGENT. A job step 
received an error at line 94 in a PowerShell script. The
corresponding line is '(New-Object system.Data.odbc.
odbcDataAdapter($cmd)).fill($ds) | out-null  '. Correct
the script and reschedule the job. The error information
returned by PowerShell is: 'Exception calling "Fill" with
"1" argument(s): "The connection has been disabled."  '.

Process Exit Code -1.
Not too familiar with postgreSQL. Thanks!
Actarus (3 rep)
May 10, 2021, 09:27 PM • Last activity: Apr 24, 2025, 01:01 AM
7 votes
2 answers
14031 views
PostgreSQL: Using the .pgpass file
I have been reading up on the `.pgpass` file, but I can’t get it working for me. My `.pgpass` file looks something like this: 127.0.0.1:5432:accounts:fred:p@55w0rd I set the privilege to `0600` (this is on CentOS Linux) and try: ```sh psql ``` Where I get the message: >psql: error: FATAL: database "...
I have been reading up on the .pgpass file, but I can’t get it working for me. My .pgpass file looks something like this: 127.0.0.1:5432:accounts:fred:p@55w0rd I set the privilege to 0600 (this is on CentOS Linux) and try:
psql
Where I get the message: >psql: error: FATAL: database "…" does not exist where is my user name. I can successfully connect if I use:
psql -u … -d accounts
so I don’t think my .pgpass file is doing its job. How can I get it to work?
Manngo (3145 rep)
Aug 8, 2021, 07:25 AM • Last activity: Mar 8, 2025, 07:40 PM
0 votes
1 answers
71 views
How to get TCP port number of currrently connected Db2 connection?
On Db2 v11.5 on Linux I can get Db2 instance TCP port number by: ``` db2 get dbm cfg | grep SVCENAME cat /etc/services | grep db2c_ ``` But I would like to get above info with SELECT statement. I would like to connect to remote database and execute some SELECT statement. How to write SELECT statemen...
On Db2 v11.5 on Linux I can get Db2 instance TCP port number by:
db2 get dbm cfg | grep SVCENAME
cat /etc/services | grep db2c_
But I would like to get above info with SELECT statement. I would like to connect to remote database and execute some SELECT statement. How to write SELECT statement to get current Db2 instance TCP port number for currently connected database?
folow (523 rep)
Feb 12, 2025, 11:44 AM • Last activity: Feb 14, 2025, 02:44 PM
0 votes
0 answers
65 views
MySQL Processlist slowly filling up with processes of state "login" and info "PLUGIN", eventually causing error 08004/1040: Too many connections
I've got a pretty basic Linux system (Debian 12) with MySQL/Percona Server 8.0.37 for Linux, using the caching_sha2_password authentication plugin for logging in onto MySQL. All my PHP-scripts (not using user root to login to MySQL!) use the `mysqli::close()` method at the end of the files/in the `_...
I've got a pretty basic Linux system (Debian 12) with MySQL/Percona Server 8.0.37 for Linux, using the caching_sha2_password authentication plugin for logging in onto MySQL. All my PHP-scripts (not using user root to login to MySQL!) use the mysqli::close() method at the end of the files/in the __destruct of the classes. When testing, I've got no I have no reason to believe that at the end of a script, connections aren't closed properly. For some reason, over time (*couple of weeks/months*), the MySQL processlist is slowly filling up with processes with state "login" and info "PLUGIN", see also the output below and the attached screenshot.
+----------+----------------------+-----------------+----------------------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
| Id       | User                 | Host            | db                   | Command | Time   | State                  | Info             | Time_ms   | Rows_sent | Rows_examined |
+----------+----------------------+-----------------+----------------------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
| 6        | event_scheduler      | localhost       |                      | Daemon  | 709122 | Waiting on empty queue |                  | 709122565 | 0         | 0             |
| 3740365  | root                 | localhost       |                      | Sleep   | 622722 | login                  | PLUGIN           | 622722577 | 0         | 0             |
| 7453355  | root                 | localhost       |                      | Sleep   | 536322 | login                  | PLUGIN           | 536322576 | 0         | 0             |
| 11165124 | root                 | localhost       |                      | Sleep   | 449922 | login                  | PLUGIN           | 449922576 | 0         | 0             |
| 14877373 | root                 | localhost       |                      | Sleep   | 363522 | login                  | PLUGIN           | 363522575 | 0         | 0             |
| 18589114 | root                 | localhost       |                      | Sleep   | 277122 | login                  | PLUGIN           | 277122575 | 0         | 0             |
| 22302053 | root                 | localhost       |                      | Sleep   | 190722 | login                  | PLUGIN           | 190722575 | 0         | 0             |
| 26013793 | root                 | localhost       |                      | Sleep   | 104322 | login                  | PLUGIN           | 104322574 | 0         | 0             |
| 29724803 | root                 | localhost       |                      | Sleep   | 17922  | login                  | PLUGIN           | 17922574  | 0         | 0             |
| 30494127 | root                 | localhost:57288 |                      | Query   | 0      | init                   | show processlist | 0         | 0         | 0             |
+----------+----------------------+-----------------+----------------------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
[![mysql processlist](https://i.sstatic.net/OSjd6J18.png)](https://i.sstatic.net/OSjd6J18.png) Eventually, after a significant amount of time, these processes take up all the MySQL connections (151, default setting), causing error 08004/1040: Too many connections, leaving no room for any PHP script to connect anymore. Using SELECT user, host, plugin FROM mysql.user WHERE user = 'root', I've narrowed it down to the caching_sha2_password plugin. [![caching_sha2_password plugin](https://i.sstatic.net/bZJiQvCU.png)](https://i.sstatic.net/bZJiQvCU.png) Killing them, using KILL on the CLI from MySQL only changes the Command from "Sleep" to "Killed", but they remain in the processlist. Restarting the MySQL server seems to fix the issue, but after some time, the same behaviour occurs again. Anyone got any clues what is causing this and how to prevent this? Killing the MySQL server every 4 weeks doesn't really feels like a solution.
Bazardshoxer (101 rep)
Jan 22, 2025, 09:46 PM • Last activity: Jan 23, 2025, 07:17 AM
0 votes
1 answers
81 views
Do long running queries get dropped when you restart the PostgreSQL instance?
Maybe this is a very basic question, but I want to be sure. I am upgrading an RDS cluster with a blue green deployment. I was checking the cluster, following the AWS guidelines, and saw a bunch of active connections. `psql -d postgres -c “SELECT * FROM pg_stat_activity WHERE (now() - pg_stat_activit...
Maybe this is a very basic question, but I want to be sure. I am upgrading an RDS cluster with a blue green deployment. I was checking the cluster, following the AWS guidelines, and saw a bunch of active connections. psql -d postgres -c “SELECT * FROM pg_stat_activity WHERE (now() - pg_stat_activity.query_start) > interval ‘2 minutes’” shows like 60 active queries. In one of our first upgrade steps, we have to restart the instance for a parameter group change. I would like to know if doing so will drop all these active connections. Most of them are idle, and almost all of them are SELECT statements, not DDL or INSERT/UPDATE queries. I am worried that if the connections are not dropped, it will affect the replication process somehow.
GBT55 (3 rep)
Jan 20, 2025, 03:15 PM • Last activity: Jan 20, 2025, 03:27 PM
0 votes
1 answers
1408 views
Identifying processes that open MySQL connections
I need to identify which application process issues a large number of MySQL connections on a Linux system. The `show processlist` sql command or tools like innotop do not really help, as they only show db user and host, and i doubt that i catch all statements that way. I was thinking to use somethin...
I need to identify which application process issues a large number of MySQL connections on a Linux system. The show processlist sql command or tools like innotop do not really help, as they only show db user and host, and i doubt that i catch all statements that way. I was thinking to use something on the network level, like tcpdump or netstat. Any suggestions?
mvw (121 rep)
Apr 1, 2021, 02:44 AM • Last activity: Jan 18, 2025, 10:04 AM
5 votes
3 answers
4694 views
MySQL general log
Is there away to have MySQL dump its log to a remote MySQL server? I would like to audit MySQL connections but I don't want the server to store all the information local on its own hardware.
Is there away to have MySQL dump its log to a remote MySQL server? I would like to audit MySQL connections but I don't want the server to store all the information local on its own hardware.
MrNemus (153 rep)
Feb 10, 2012, 11:54 PM • Last activity: Jan 8, 2025, 07:08 AM
0 votes
1 answers
441 views
Environment variable $PGUSER does NOT take effect with Postgresql client?
For many years I have used to use the environment variable `$PGUSER` when I work with client tools such as psql/pg_dump/pg_restore. Recently I build up a new PG13 server, the env var `$PGUSER` does **NOT** take effect, when I try to use the client tools on a terminal of the server. I get message lik...
For many years I have used to use the environment variable $PGUSER when I work with client tools such as psql/pg_dump/pg_restore. Recently I build up a new PG13 server, the env var $PGUSER does **NOT** take effect, when I try to use the client tools on a terminal of the server. I get message like this: > leon@mamba:~$ echo $PGUSER > > postgres > > leon@mamba:~$ psql > > psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: > > FATAL: role "leon" does not exist If I use the tools on a terminal of another physical computer, the env var takes effect normally. Of course, the var has been set on both machines. My pg_hba.conf: > \# TYPE DATABASE USER ADDRESS METHOD > > host all all 127.0.0.1/32 trust > > host all all 192.168.x.x/16 md5 > > \# IPv6 local connections: > > host all all ::1/128 trust
Leon (411 rep)
Oct 21, 2024, 07:22 AM • Last activity: Oct 22, 2024, 01:54 PM
2 votes
2 answers
126 views
Error while connecting Local DB 2012 in Windows 7 PC using SSMS
I am trying to access LocalDB 2012 on my Windows 7 SP1 PC. I have successfully installed LocalDB and started the instance using the command line, and it is currently running. However, when I attempt to connect to this LocalDB instance using SQL Server Management Studio (SSMS), I receive the followin...
I am trying to access LocalDB 2012 on my Windows 7 SP1 PC. I have successfully installed LocalDB and started the instance using the command line, and it is currently running. However, when I attempt to connect to this LocalDB instance using SQL Server Management Studio (SSMS), I receive the following error. > A network-related or instance-specific error occurred while > establishing a connection to SQL Server. The server was not > found or was not accessible. Verify that the instance name > is correct and that SQL Server is configured to allow remote > connections. > (provider: SQL Network Interfaces, error: 26 - > Error Locating Server/Instance Specified) > (.Net SqlClient Data Provider) I have verified the following configurations, and they seem to be working correctly as mentioned in the Link - TCP port is enabled. - SQL Server Configuration Manager is installed. - SQL Browser service is running. - Port 1433 is open. Also note that I have tried connecting using the following instance names, but without success: I have attempted to log in using Windows Authentication. (localdb)\v11.0 (localdb)\mssqllocaldb Given all of this, what could be the cause of the issue.? How can I solve this issue?
RD Seeker (35 rep)
Oct 16, 2024, 07:13 AM • Last activity: Oct 22, 2024, 04:41 AM
0 votes
0 answers
40 views
Need help with ER diagram for my pet project
Right now, I have started to learn more about databases. One of the topics that I have more questions about is the **relationships between tables**. For example, I am currently trying to create an **ER diagram** for a project where you would first buy a plant and then receive notifications about whe...
Right now, I have started to learn more about databases. One of the topics that I have more questions about is the **relationships between tables**. For example, I am currently trying to create an **ER diagram** for a project where you would first buy a plant and then receive notifications about when it needs watering. **Could you please let me know if my connections are correct and if they need any improvements?**Entity relationship diagram
mariyka_soul (1 rep)
Sep 30, 2024, 12:16 PM
Showing page 1 of 20 total questions