Questions tagged [mysql-pconnect]

The `mysql_pconnect` function opens a persistent connection to a MySQL server.

The mysql_pconnect function opens a persistent connection to a MySQL server. However, this function, along with all other mysql_* functions, are deprecated in PHP and should be avoided (see the red box). Consider using prepared statements with either PDO or MySQLi instead.

19 questions
26
votes
5 answers

mysql_connect VS mysql_pconnect

I have this doubt, I've searched the web and the answers seem to be diversified. Is it better to use mysql_pconnect over mysql_connect when connecting to a database via PHP? I read that pconnect scales much better, but on the other hand, being a…
rogeriopvl
  • 51,659
  • 8
  • 55
  • 58
7
votes
5 answers

mysql_pconnect(): send of 5 bytes failed with errno=32 Broken pipe

I've been using the same DB abstraction library for years. But today it started writing these Notice (8) messages in my log. The application is working correctly but every time a script connects to the DB the same notice is logged. I cannot think…
user213154
7
votes
2 answers

MySQL persistent connections and advantages of mysql_pconnect?

I had never heard of persistent connections before, and I don't understand the advantages. I run a PHP/MySQL based website, it receives tens of thousands of page views per day. In my header file on each of these pages I have just used…
Juddling
  • 4,594
  • 8
  • 34
  • 40
6
votes
5 answers

php pconnect vs connect

If I have a script which inserts data then exits, the script will be opened by 100 users at the same time or within 2 mins. (Actually I'm doing email tracking.) So pconnect is better, or connect is better to reduce the resource? I have close when…
user192344
  • 1,274
  • 6
  • 22
  • 36
4
votes
1 answer

Does Drupal support persistent DB connections?

Does Drupal support persistent DB connections? If yes, how do you set them up and what are the downsides? If no,... why not?
Pia Rosen
  • 41
  • 2
2
votes
1 answer

Propel and Persistent Connections

I'm having issues with a large number of conncurrent connections to an Amazon RDS database using propel as the ORM with PHP. The application runs fine during load testing with 20 to 50 connections open at a time, then seems to hit a wall, mushrooms…
CargoMeister
  • 4,199
  • 6
  • 27
  • 44
1
vote
1 answer

Best way to optimize database performance in mysql (mariadb) with buffer size and persistence connection configurations

I have; a CRUD heavily loaded application in PHP 7.3 which uses CodeIgniter framework. only 2 users access to application. The DB is mariadb 10.2 and has 10 tables.In generally, stored INT and engine default is InnoDB but in a table, I store a…
myalcin81
  • 187
  • 1
  • 13
1
vote
0 answers

mysql_pconnect issues

I have a problem with mysql db connection.. My application does a lot of queries to the database. And loads results of the query in the page. Before, I used mysql_connect for the connection. I separated it in a different file the connection and…
tinks
  • 11
  • 1
1
vote
2 answers

mysql connection from daemon written in php

i have written a daemon to fetch some stuff from mysql and make some curl requests based on the info from mysql. since i'm fluent in php i've written this daemon in php using System_Daemon from pear. this works fine but i'm curious about the best…
fjallstrom
  • 145
  • 1
  • 2
  • 10
1
vote
0 answers

mysql_close and mysql_pconnect not working

I have this scenario: [ file: config.php ] $conn=mysql_connect(... mysql_select_db [ file: function.php ] include('db.php'); function a() { mysql_query("INSERT INTO..."); } [ file: index.php ] include('function.php'); a(); mysql_close($conn); in…
Helixior
  • 55
  • 1
  • 4
1
vote
2 answers

when does mysql_pconnect() connection gets closed

It is know that connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect()). So when does the…
indianwebdevil
  • 4,879
  • 7
  • 37
  • 51
1
vote
0 answers

When does php's mysql_pconnect consider a connection to be "available"?

I'm using php-fpm (a fastcgi php manager) and am confused about when php would consider a persistent connection created with mysql_pconnect to be available instead of creating a new one. Whenever I try enabling mysql_pconnect vs mysql_connect my…
crickeys
  • 3,075
  • 3
  • 26
  • 27
0
votes
1 answer

I am trying to make a seat reservation system for a project . this code isn't able to show which seats are already occupied

*this code helps one to book a seat but is unable to show the occupied once. I am not able to understand how can store those seats and show them as occupied. do install tkinter on your device before running this code * from tkinter import * def…
0
votes
3 answers

Mysql_pconnect alternative in order to work

So I know that mysql_pconnect is deprecated, is there a way actually to make this work, I have an old script which in the connection file has the following: $success = mysql_pconnect ($mysql_host, $mysql_user, $mysql_password); if (!$success) …
Uffo
  • 9,628
  • 24
  • 90
  • 154
0
votes
0 answers

PHP cronjob failed due to mysql error

i set a cronjob from cpanel but unexpectedly it cause mysql error. This is the command i set from CPANEL: php -f /home/server1/public_html/xad/imp.php It need to be executed after half hour. 1) This job runs from browser without issue. 2) Also…
Asad kamran
  • 440
  • 10
  • 21
1
2