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
2
votes
0 answers

MariaDB / Galera - Hanging node freezes whole three node cluster

i hope you are all healthy. :-) Currently I have a recurring problem. Our database cluster, consisting of three nodes, currently fails almost daily. The reason is repeated that one of the three nodes hangs and thus somehow hangs the whole cluster.…
2
votes
1 answer

Drupal 4.7 Unable to connect to database server

This is strange, in Drupal 4.7 (a new install) I can get it to come up with a page that says "Unable to connect to database server" when I have not put in the DB connect information. This comes up in the browser just fine. So I go in an put in the…
Patrick
  • 3,302
  • 4
  • 28
  • 47
2
votes
5 answers

How declare a php variable to hold the return value of "mysql_connect()"?

I need to save the value of mysql_connect() in a global variable that's accessible in every php file in my project for example, $db_ServerVal = mysql_connect(). I need to be able to call mysql_connect only once, at the start of the program. Then in…
wantTheBest
  • 1,682
  • 4
  • 43
  • 69
2
votes
3 answers

How to know library is debug library or release?

I am using mysql cpp library . I checkout the recent copy from there bzr trunk and used cmake to generate library . First time I used release mode and second time I used debug mode to build. The both library have a mysql_debug.cpp U…
Vivek Goel
  • 22,942
  • 29
  • 114
  • 186
2
votes
4 answers

mysql_connect timing out

I am trying to set up a PHP framework on my Mac 10.6 computer, and it keeps erroring during setup due to database connectivity issues. So I put together a small php script to see if I could connect to the server myself, and it couldn't either. The…
picardo
  • 24,530
  • 33
  • 104
  • 151
2
votes
3 answers

Why does mysql_connect break my .php?

I have the following code running on Apache 2.2 with PHP 5.3.3:
Bloodyaugust
  • 2,463
  • 8
  • 30
  • 46
2
votes
3 answers

PHP MySQL problem

Whenever I try to run a php script on my website hosted by hostgator, I get this error: Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'pieboy13_(user name)' (1) in…
user497721
  • 21
  • 2
2
votes
1 answer

Does calling a blocking function inside libev event callback function blocks whole app?

I use libev to develope my event-driven app. I like to query remote mysql server inside events. so, Do mysql_real_connect block whole application or just my_read_cb according to following code my_read_cb(EV_P_ ev_io *w, int revents) { …
jafar
  • 345
  • 4
  • 11
2
votes
4 answers

mysql_connect doesn't work with localhost on my Windows machine

This does not work with my PHP 5.3.3 installation on WAMP / Windows 7: mysql_connect('localhost', 'root', ''); After Maximum execution time, this error is presented: Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt…
Markus Hedlund
  • 23,374
  • 22
  • 80
  • 109
2
votes
2 answers

Configuration file '' can not be found

I'm using mysql-server 5.5 and had created a server instance. After created I try to open the instance editor and select Options File in CONFIGURATION but it says Configuration file '' can not be found. New file will be created on apply of…
gamo
  • 1,549
  • 7
  • 24
  • 36
2
votes
1 answer

AWS RDS: How to access/connect to RDS MySql DB From localhost

I am very new to Amazon Web Services, I have created Mysql DB on RDS and stored some data. Now i want to connect to RDS db from localhost(which is in running on my desktop) ,Tried as fallow in my PHP connection. $con =…
Kiran
  • 61
  • 1
  • 7
2
votes
1 answer

mysql_connect doesn't work second time

duplicate of unanswered: How to reconnect in php adodb after exceptions: Mysql server gone away or Lost connection to MySQL server during query mysql_connect works the first time, but never works after that... $connectDb = mysql_connect(secret,…
user3338098
  • 907
  • 1
  • 17
  • 38
2
votes
1 answer

mysql_connect not being recognized as a function/PHP not connecting to MySQL in Apache

A little background for context: I'm pretty new to programming and such, and I have been trying for the past few months to set up a development environment on my laptop so I can practice with some basic stuff--PHP, Javascript, MySQL, possibly Python…
2
votes
2 answers

php MySql connectivity error

I have the following php code to connect to my mysql DB. mysql_connect( "myserver.com" , "root", "redhat","datastore") or die(mysql_error()); when I ran this code I got the error saying: Warning: mysql_connect(): Host '10.21.21.10' is not allowed…
PaDi
  • 255
  • 1
  • 5
  • 16
2
votes
2 answers

mysqli_connect() suddenly extremely slow

I have not changed anything in this situation recently, but recently my mysqli_connect() to a remote server is very slow (about half the time it hits the 30 second max execution time). When it works, the response time is between 28 and 30 seconds.…
Sarah Kemp
  • 2,670
  • 3
  • 21
  • 29
1 2
3
12 13