Questions tagged [mysql-connect]

The `mysql_connect` function opens a connection to a MySQL server.

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

192 questions
0
votes
0 answers

Flask App loses connection to MySQL database after about a day

I'm using python flask as a backend, running it as a service in the GCP instance. It is working correctly once started the service. But after a day when I try to make an API call it losses its connection with MySQL and shows the following error…
0
votes
1 answer

Authentication problem on access MySQL from PHP

I'm moving an old application between two windows server (see data below). I keep attention to have php.ini, my.ini, httpd.conf, httpd-vhosts.conf alligned. I know, PHP version is too old and even worse the code use mysql_connect. On the old server…
mYmage
  • 92
  • 2
  • 14
0
votes
2 answers

PHP mysql_connect vs Ubuntu mysql terminal use

I'm using PHP in order to connect to MySQL with the following way: $link = mysql_connect('...host...', '...username...', '...password...'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; and it…
Nick Fr.
  • 1
  • 1
0
votes
1 answer

¿Can i set in Mysql the use of two different data base at the same time?

I have a site in a server, and the data base in other server. My site was connected with two differnt data bases at the same time without any problem, but when I change the server's data base I had a problem, my site did not recognice two…
0
votes
1 answer

How to use MYSQLI_CLIENT_INTERACTIVE flag in Wordpress?

So we can add a flag to Wordpress database. I can see it in wp-db.php. I see this code: $client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0; But I couldn't see anywhere I can define MYSQL_CLIENT_FLAGS. Where should I do it?
Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
0
votes
2 answers

Mysql connection with python

this code runs without error but no records are added to the database mydb=sql.connect(host="localhost",user="root",passwd="") cmd=mydb.cursor() cmd.execute("create database if not exists library") cmd.execute("use library") cmd.execute("create…
0
votes
1 answer

Call to a member function query() on null PHP5.6

I have cerb2 https://github.com/wgm/cerb2, it is an old ticketing system, it might looks weird but I have a a lot of knowledgeable information burried that I want to exploit. It is basically a PHP5/Mysql software with the mysql_connect()…
lambda79
  • 45
  • 5
0
votes
1 answer

Changing the mysql.sock

I am new to codeigniter and i am installing this shopping cart that is written in codeigniter 2.0 and i have the database created and when i try to run i get this error An error #2 occurred in script…
Matt Elhotiby
  • 43,028
  • 85
  • 218
  • 321
0
votes
2 answers

SQLSTATE[HY000] [2002] Connection refused in laravel

i have this problem with laravel, this is my .env…
0
votes
1 answer

php connecting to mysql doesnt work (raspberry pi 3 / apache2)

So i have this simple website for my family but somehow it doesnt work anymore since i moved it to my raspberry pi. It worked perfectly fine on my PC using xampp though. i have this code right at the beginning of the document: $msqlUser="root"; …
Lugico
  • 3
  • 2
0
votes
1 answer

MySQLi real_connect Failed

I'm unable to connect MySQL database(that exists in another server) with SSL in below PHP code. I tried the steps from the link: https://learn.microsoft.com/en-us/azure/mysql/howto-configure-ssl Can anyone advise me what should be done from those…
Deepak Keynes
  • 2,291
  • 5
  • 27
  • 56
0
votes
1 answer

MySQL Connector/C++. Trying to stop connecting to a DB in the process of it

... options["OPT_WRITE_TIMEOUT"] = timeout; std::lock_guard locker(mutex_); auto driver = sql::mysql::get_driver_instance(); connection_.reset(driver->connect(options)); ... This code is being executed in a single thread.…
0
votes
1 answer

Pentaho failing connection durring Job

Im importing data from Microsoft SQl database to MYSQl data base. I created a seperate transformation for each table input so i couldnt control the order of the imports of each table. the transformations all work when i run them seperatly but when I…
0
votes
2 answers

LAMP settings – PHP and multiple DB connections with mysql_connect()

I was assigned to maintain prehistoric PHP application, which uses some 'phpDB' class written by Joe Thong, last updated in 1999. This application connects to two different databases on the same server, taking some data from one and another from the…
Adam Kiss
  • 11,811
  • 9
  • 48
  • 81
0
votes
2 answers

How can mysql_connect function be supported in php7.0 by using a patch

I am running codes that were running on php5 that support mysql_connect and I have migrated to another server that has php7.0. I realized that php7.0 does no longer support mysql_connect but it supports mysqli_connect. I don't want to go back to…
Innocento
  • 21
  • 1
  • 4