mysql-connect

Any way to trace MySqlConnection to detect reasons for slow connection

眉间皱痕 提交于 2020-01-07 02:26:07
问题 I need to find some way in C# to trace the MySqlConnection.Open() methods connection to find out why it's taking over 15 seconds just to establish the connection. I.e to see some kind of connection log to find out whats holding it up. The code below is in an otherwise empty project and I've tried disabling the firewall and changing the port. Please help I've been trying to fix this for two days now and I'm almost admitting defeat. EDIT: Also the port is 3310 instead of the 3306 mySQL default

mysql_connect(): No such file or directory

牧云@^-^@ 提交于 2020-01-01 04:17:10
问题 I have just installed a MySQL server (version 3.23.58) on an old RedHat7. I cannot install a more recent MySQL version because of the dependencies. I cannot update librairies on this RedHat server. However, I have a problem connecting to the database with PHP. First I used PDO but I realized that PDO was not compatible with MySQL 3.23... So I used mysql_connect() . Now I have the following error: Warning: mysql_connect(): No such file or directory in /user/local/apache/htdocs/php/database.php

MySQL database config in a separate class

南楼画角 提交于 2019-12-22 13:47:08
问题 Is it possible to keep all my database related configuration (hostnames, usernames, passwords, and databases) as well as the function to connect to and select the correct database in a separate class? I tried something like this: class Database { var $config = array( 'username' => 'someuser', 'password' => 'somepassword', 'hostname' => 'some_remote_host', 'database' => 'a_database' ); function __construct() { $this->connect(); } function connect() { $db = $this->config; $conn = mysql_connect(

php mysql_connect resource is allways the same

痴心易碎 提交于 2019-12-22 10:27:16
问题 I'm having a problem my php script witch you can see here: http://codepad.org/F0qhElRC Is not opening a new resource for each connection from a child. Already I tryed using 127.0.0.1 or my local network IP but nothing worked, also max_user_connections in mysql is set to 0 opening a connection from web gives me a different resource for the web. But in the command line it uses the same. In mysql_connect I specified new_link to be true, I placed a __destruct in the bd class to close the

Error while connecting to Database on hosted server

做~自己de王妃 提交于 2019-12-13 11:19:39
问题 Warning: mysql_connect(): (HY000/2002): Connection refused in /home/vol14_1/byethost31.com/b31_16461744/htdocs/Mysql/con.php on line 7 Warning: mysql_select_db(): No such file or directory in /home/vol14_1/byethost31.com/b31_16461744/htdocs/Mysql/con.php on line 8 Warning: mysql_select_db(): A link to the server could not be established in /home/vol14_1/byethost31.com/b31_16461744/htdocs/Mysql/con.php on line 8 I have the below code <?php $localhost="localhost"; $username=b31_16461744; $pass

Access denied for user 'test123'@'192.168.0.38' (using password: NO)

梦想与她 提交于 2019-12-13 09:30:34
问题 I want to run this code on byethost31.com (free hosting site) so i am facing " Access denied for user 'test123'@'192.168.0.38' (using password: NO)" Error on console.. <?php $localhost="*************"; $pass="*************"; $usename="*************"; $dbname="*************"; $s=mysql_connect($localhost,$pass,$username); $t=mysql_select_db($dbname); if($s ){ echo "Mysql_connect is successful. <hr>"; } if($t ){ echo "Mysql_select_db is successful.. <hr>"; } ?> 回答1: If you check the

Using same session ID in ajax can't connect to MySQL DB

☆樱花仙子☆ 提交于 2019-12-13 03:10:00
问题 I have made a generic PHP script to use for an AJAX call. I have the username and password for the mysql connection stored in SESSION variables. In order to start the same session in this ajax script, I pass the session ID via post to the ajax script. The variables are being passed correctly and I checked using error_log that the username and password SESSION variables are the correct values. Here is the ajax_script.php: <?php session_id($_POST['session_id']); session_start(); mysql_connect(

Configuration file '' can not be found

落花浮王杯 提交于 2019-12-11 12:09:50
问题 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 changes and then Configuration file did not contain section [], so a new one was added. If that is not correct, please fix the section name in the Server Instance Editor and reopen the administrator. But I have checked and see that I have a my.cnf at /etc

MySQL connect failed. Can't connect to MySQL server on 'http' (4)

落花浮王杯 提交于 2019-12-11 08:48:41
问题 I try to connect my android application using JSON Parser to the web hosting. But whenever I try to connect (even just open using url in the browser) I will get the error message. <?php $dbHost = 'http://sql4.000webhost.com/localhost'; $dbUser = 'a6410240_cbetTD'; $dbPass = 'xxxxxx'; $dbName = 'a6410240_cbetTD'; $conn = mysql_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect failed. ' . mysql_error()); mysql_select_db($dbName,$conn); ?> This is my database.php file. The full error