Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Remote MySQL Connections, Still Not Working


I've read, and done all the tutorials, forum posts, and comments I could find regarding setting up a mysql server access for remote connections, but I still seem to have problems. I have a LAMP server running behind a closed router connection. A dynamic DNS is masking the connection, and I have the appropriate ports open for HTTP, SSH, VNC, FTP, and I thought MySQL (3306). But for some reason I still cannot get MySQL to connect from a foreign host.

The I have port forwarding (3306) to the correct system behind the router, and I can access the server just fine via http/ftp. The MySQL server is happily running PHP MyAdmin with the localhost connection too. I've set a (actually a couple now) user to have the ip access of "%", and granted all permissions to that user, flushed the permissions, even restarted the server. I still can't get the remote connection to work.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MySQL Max Connections Remote And Local
My website runs on two servers. One is mean't for PHP and the other is the database MySQL. Whenever a request is made, the PHP attempts to connect to the MySQL via a remove host variable in the mysql_pconnect() function. This works fine, however when it comes down to having lots of connections in the my.cnf file, which one do I edit?

max_connections = 1000

Now do I set this in the MySQL only, or do I set it in the PHP server as well?

Remote ODBC Connections To MYSQL
I have a requirement to do some standard table work with existing online survey software (PHP based- using MYSQL). I would like to test the ability to do this work from desktop clients such as access or open office.
I have set up an ODBC connection on my machine with appropriate passwords etc. When I run the test in the WinXP ODBC diaglog, it is says that connection is succesfull.

However, when I try to use the same DSN in ACCESS or the database component of Open Office, it is that it is unable to make the connection. For example in ACCESS, trying to link tables, the message comes that the ODBC call fails.]

In OPEN OFFICE when I do the test connection, I get "ACCESS DENIED" for user... which is the user account and password that I use in the web based projects.

Enabling Remote Connections
Can someone tell me how to set up the mysql server to accept remote connections?

Im using mysql 4.1 on Linux Ubuntu 5.10

I have tried editing my.cnf and changing the bind-address from 127.0.0.1 to the server's IP address, but this just results in the server failing to restart with the following error:

Starting MySQL database server: mysqld...failed.
Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!


What do I have to do to get it to accept local and remote connections? Code:

Enable Remote Connections
When we connect to the database server on the same PC, we give the server as "localhost"
When I tried to connect to the database on another PC by giving the hostname as server it gives the error as

Access denied for user 'root'@'hostnmae'

Can someone tell me how do I make sure remote connections are open for this mysql database and how can I identify it from another PC?

Remote Access Not Working: Error 1251 Client Does Not Support Authentication Protocol Requested By Server
I'm trying to set up my MySQL database for remote access. I've never been a DB admin so this is all mostly new to me. I am binding to my public IP address, and I have created a new user with the following grant commands run from the mysql command line on the server:

mysql> grant all privileges on prs_data.* to 'username'@'%' identified by 'change';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on prs_data.* to 'username'@'localhost' identified by 'change';
Query OK, 0 rows affected (0.01 sec)

When I try to connect remotely from another host, here's what happens:

MySQL Remote Backups - No Access To FTP Or Remote Command Line
I have a mySQL database located on a remote host's server. I would
like to schedule a task on my local Windows computer to retrieve a
backup/dump of this remote database.

I have contacted my host, and they indicated that the server is only
open to the Internet via mySQL. Therefore, even if I did have access
to that server's command line (which I don't) to create dumps via
mysqldump, I would not be able to retrieve via FTP.

Does anybody have any ideas as to how I can generate backup files from
my local computer through a local command-line interface? I have done
it through a GUI (DBTools), but I would like to have it done via DOS
batch, so that I can schedule it. Does anyone know of any mysql backup
GUIs with command line switches? Or can somebody recommend an
alternate means of getting a local backup?

# Of Mysql Connections
I was wondering what you guys thought about this. How many mysql connections do you think is to many on a php page?

Mysql Connections
I am currently running MySQL 5.0 on RHE3.

I would like to know if someone can tell me how can I get the total number of connections/session to the mysql server via the console or command line?

MySQL Connections
A shared hosting provider allows to setup 10 MySQL databases. The only thing is that each database is forced into having its own username and password, which means a separate connection has got to be made to each database.
Is there a way to join tables over the two connections

How Do You Open Mysql To Outside Connections?
I have a DB server and an APP server.

I am trying to open MySQL on the DB server so the APP server can connect to it.

I did the command:

GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%'
IDENTIFIED BY 'PW' WITH GRANT OPTION;

However, it still won't connect.

Closing MySQL Connections
Here's a question for you, my hosts have told me that that one my pages,
php, was causing their server to reboot because there were too many open
connections and that they should be closed.

Now, correct me if I am wrong but I thought that the connections were closed
after a minute of inactivity.

Does this sound right? Could open connections cause their server to reboot a
lot, say 3 times in 15 minutes? If so, what can I do about it?

How Do You Stop All The Connections To MySQL?
I don't want any application accessing my databases while performing the recovery operations. In Oracle, you can stop the TNS listener on the server side. What is the equivalent of this in MySQL?

Managing MySQL Connections...
MySQL is currently reaching its limit of connections, and is not responding to new ones. What would prevent against this?

Would closing the connection through PHP at the end of every page help with mysqli_close();

Or should I set my max_connections in the my.ini configuration file to a higher number?

What other ways can lower the amount of connections?

Best Practices For Php/mysql Connections
I'm working on a data intensive project right now and though I'm able to write code I'm by no means a php or mysql guru, to say I know 'just enough' would be a good statement. So I'd like to ask those who know better...

Without going into specifics; users will be searching the database, and/or adding data to the database. I would estimate that there will be far more searches than additions/edits.

One of my main concerns is managing the connection to the database for each user. What would the most efficient method be, generally speaking? I would think that I do not want them to establish a connection for each request.

Getting Mysql Error Too Many Connections
I have limited controll of the server settings for MySQL all I can do is create a database, a database user and delete database. I can also use myPhP admin to manage the tables and stuff but as far as controlling the sql server thats all on the hosting company.

I recently set up a forum boards (SMF forums its great) all of a sudden one day I went to optimize the tables and whammo the whole board stopped working.

When I went to log into plesk and go into My Php admin it keeps giving me this error

"Welcome to phpMyAdmin 2.6.0-pl3

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.

MySQL said:

#1040 - Too many connections

What exactly is this error and how do I fix it. I am a noobie with My Sql

is this a problem with my hosting companys server or is this an issue I can fix?

My hosting support said my database is corrupt (figured that much) but I can't restore untill I can overcome this error..

Several /tmp/mysql.sock Connections
I did a netstat -an and I saw around 80 lines like this:

c41cd9d8 stream 0 0 0 c41cd230 0 0 /tmp/mysql.sock

Is the server holding too many connections and then cant handle anymore?

What can I do to fix this?

I am running Mysql 3.23.49 with persistant connections off.

Netstat And 500 MySQL Connections
I was performing some benchmarking on my app and discovered that it opens 400-500 MySQL connections show by the netstat command:

tcp 0 0 enssbos:36185 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36184 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36191 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36190 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36189 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36188 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36179 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36177 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36176 enssbos:mysql TIME_WAIT
.
Does this look right? Why are there so many tcp network connections for one script? I do use ajax with multiple updates, but I feel as if I am going to run into problems here.

Closing Persistent Connections In Mysql
it might be a stupid question,but I just want to know how can we close persistent connection in mysql (using php).

what are the advantages and disadvantages for using persistent connection?


Tracking MySQL Outgoing Connections
I currently have this serious issue where a bunch of mysql connections are being sent from one of my servers to another. I think its a virus or some sort of hole in my scripting but my main server keeps on sending fake logins to my database server.

I do not know how this is happening, but IS THERE A WAY for the mysql client (not the database server) to track all of the outgoing connections that are being made?

Mysql Too Many Connections Performance Issues
I have a website running on a linux/apache/mysql/php
server. I receive about 8,000-10,000 visitors a day with about 200,000
to 300,000 page views. The server is a RedHat Linux server running PHP
5.x, MySQL 5.x, Apache 2.x

We have been suffering from a number of performance issues. Our
hosting company has set our max connections to 100, and we are using
persistent connections in PHP. At times the mysqld process takes 100%
of the CPU. We have also been suffering from
mysql_pconnect(): Too many connections errors. What can I do to fix
these issues?

When I run a top on the server I see this ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5567 mysql 16 0 169m 42m 4236 S 81.2 4.2 3078:09 mysqld
32539 apache 15 0 42676 25m 7708 S 1.0 2.5 0:03.40 httpd
32572 apache 15 0 42680 25m 7708 S 1.0 2.5 0:02.98 httpd
32608 apache 15 0 42680 25m 7704 S 1.0 2.5 0:00.72 httpd
32542 apache 15 0 42704 25m 7712 S 0.7 2.5 0:03.38 httpd
32561 apache 15 0 42732 25m 7712 S 0.7 2.5 0:02.61 httpd
32567 apache 15 0 42680 25m 7708 S 0.7 2.5 0:02.60 httpd
32591 apache ...................................................

External MySQL Connections Error
I'm trying to connect from my computer to my server. I add my computer to the allowed access hosts. And I'm able to logon correctly. But when I try to select the database I get this error: Access denied for user 'USER'@'%' to database 'DATABASE'

Any ideas?

How Can I Configure My MySQL Server To Allow OUTSIDE Connections?
how can i configure my MySQL server to allow OUTSIDE connections?

MySQL 4.0 Refusing Local Connections
I am hardly an expert on MySQL. I have limited knowlege on how MySQL 4.0 works.

I have used MySQL 4.0 nearly half a dozen times, using these steps, and everything working flawlessly.

Download MySQL 4.0 without installer, Extract it to c:mysql. go to c:mysqlin, run winmysqladmin.exe, it will prompt for a username and pass. I type in a fresh combonation. It will start up. I will install the service, and then add the service using the systray icon that appears from winmysqladmin.exe.

Now i am capable of logging in with root, set permissions, build databases, etc... etc...

For some reason, I cannot figure out why. It is now refusing all local connections.

The server is running windows 2000 advanced server. When i install it i do it with the remote desktop connection. simply because the server itself is 1300 miles away.

Working Of Mysql
can any one explain me in details how mysql engine works

PHP Not Working With MySQL
Just starting out and I have PHP, Mysql, and Apache installed. PHP and MYSQL dont seem to be working together. Everything seems to be running fine and I edited the httpd.conf in order to allow apache to process php requests.

This is what I am doing when I start mysql...
c:/net start mysql
c:/mysql/bin/mysql -u root -p
Then I log in and it accepts the log in.

When I create a sample php program like "Hello", it works.

But when I do a simple sql connect:

<?php
$conn = mysql_connect("localhost","root","tntboy");
echo $conn;
?>

I get nothing! Nothing at all comes up on the screen.
Any ideas? Why is it not connecting to the database?

Still Cannot Get MySQL Working
I have the MySQL server running. I have installed MyODBC. I cannot get either the Migration Toolkit or the MySQL Administrator to connect. I've turned off the Windows Firewall and put exclusions in Norton to allow port 3306 and MySQL.

With the MySQL Administrator I get an error message of Cannot Connect to MySQL Server on localhost. With the Migration Toolkit I get this error log: Code:

Mysql Not Working
im trying to install bugzilla (im on rh9) ive gotto the point where you run ./checksetup.PL.
Thing is its saying it cant connect to the database - but the database is there and the settings n the config files are right.

Webserver Leaving Many Unauthened Connections On Mysql
MySQL 4.0.24_Debian-10sarge2-log

I have a seperate mysql server and several webservers. One of them recently had an upgrade from debian 3.2 to 4 . Also many things like apache and php got upgraded. This webserver works, but its going slow sometimes. When I check mtop on the mysql server, I mostly see something like this :

ID User Host Command State
8606722 unauthen ip:422 Connect login
8606729 unauthen ip:422 Connect login
8606733 unauthen ip:422 Connect login
8606734 unauthen ip:422 Connect login

there are usually about 20-40 of those lines, with ip being that of the updated webserver. The only other lines are about 20 waiting 'Delayed, waiting for' lines for delayed inserts (wich is normal), and now and then a real mysql query.

All the other webservers do not seem te behave like this, so I'm not sure if this really is a mysql problem. But what I want to know is : what can I do to avoid those hanging connections ? Sometimes there are so many of them, that mysql is running out of connections and is blocking access from other webservers. I can raise this value ofcourse, but that is not a real solution of the core problem.

Mysql Heavy Load On Databases And Connections?
I'm preparing for a lot of potential traffic to a web app. My question is. Is there any restriction on the amount of databases you have on a single mysql installation on a linux server. Could there be any performance issue if for example I had 100,000 databases all being connected to at different times?

What is the upper limits of a standard LAMP dedicated server? What i mean is how many simultaneous connection can it handle before it starts to slow down for the users?

Cleaning Up MySQL Connections To Avoid 1040
Well, I'm trying to run
PHP

$result = mysql_query("SHOW FULL PROCESSLIST");
while ($row=mysql_fetch_array($result)) {
    $process_id=$row["Id"];
    if ($row["Time"] > 200 ) {
        $sql="KILL $process_id";
        mysql_query($sql);
    }
}


To clean up my connections, as I'm getting a 1040 error "too many connections". Of course, I can't run this until I can actually connect, unless there is a way around somehow. I don't have any admin rights, I just have a web-based "php my-admin" module to run the db.

Every page people access opens a mysql connection, and then it is closed with
PHP

mysql_close($connection);


. Would putting in
PHP

<?php mysql_close($connection); $NASI_connection = null;?>


MySQL Persistent Connections, Stored Procedures
We have a PHP/MySQL based website. It's our first project where the DB work is being handled my someone else the client hired. They are having us use a lot of stored procedures they created.

We've found that in order to run the procedures we have to use a persistent (mysql_pconnect) connection in our PHP scripts. Otherwise, using mysql_connect, ALL the stored procedures generate a mysql error. If we use pconnect they don't. Is this normal to have to use pconnect with stored procedures and if not, what could be the cause?

The second problem we are now running into is we are unable to connect to the database because we are exceeding the max connections. Even on our development server which uses a separate database on a separate server with maybe only has 5 or 6 different people that know about the website and use it.

The production site is maxed out, getting a too many connections error message. We are still invetigating but I believe they said there were 40 connections to the database. The website is inaccessible because it can't connect.

I guess another thing I'm curious about is on a website that is very DB intensive and has maybe a max of 50 simultaneous users at a time, what would a reasonable setting be for max connections on MySQL considering we have to use persistent connections?

MySQL Redhat Slow Responding To Connections
I have installed MySQL 3.53 on two RH7.3 and one RH9.0 boxes.
On one of the 7.3 and the 9.0 box, when I try to connect remotely, it
takes about 45 seconds to connect, whereas the other 7.3 box connects
almost immediately.

The fast box has standard install of 7.3 with tomcat added.
The 9.0 box is straight RH9.0 standard install.

I can't find anything in common between the slow boxes, but not on the
fast one.

Shouldn't Mysql_pconnect Force Reuse Of Mysql Connections?
I have this function I call everytime I need to make a query from within
my php-scripts:

function db_connect ($user, $pwd, $db, $debug = 0)
{
$link = @mysql_pconnect("localhost", "$user", "$pwd");
if($link && mysql_select_db("$db"))
if($debug == 1) {
printf("Connection OK!");
}
Return ($link);
if($debug == 1) {
printf("Connection not ok!");
}
Return (FALSE);
}

I thought that making another or a third call to db_connect would reuse
the same connection to the database, since I use mysql_pconnect() to
connect. But listing the active processes indicates something else: Code:

MySQL Server Initialize Broken Connections
I'm working on program that acts as MySQL client. After successful connection
program send queries for a long time. When I stop server mysql_query return
error (no surprise). But when I start server my program recieve information
again without connection reinitialization.

I suppose MySQL server track connections somehow but I didn't find any info
about it in documentation. Can somebody point me to docs or explain this
behaviour?

Maximum Number Of Connections In MYSQL (community Server)
how many maximum connections can reside in connection pool of MySQL server- community? Also what are the major differences between the Enterprise and community server versions?

Working With Images In MYSQL
How do I store and retrieve images in MYSQL database, and display this image on a web page, using PHP.

MySQL Not Working After Reboot
I just installed MySQL 4.0.18 on my Win2K computer. Once it installed, I
ran the WinMySQLAdmin program and everything worked fine. The little green
light was on, and I could connect to my databases.

However, as soon as I restarted my computer, the green light changed to a
red light, and since then I've been unable to connect to my databases. When
I open WinMySQLAdmin, the "Server" group box on the Environment page is
completely empty (it used to have lots of server information in it).

MySQL Not Working After Reboot
I just installed MySQL 4.0.18 on my Win2K computer. Once it installed, I
ran the WinMySQLAdmin program and everything worked fine. The little green
light was on, and I could connect to my databases.

However, as soon as I restarted my computer, the green light changed to a
red light, and since then I've been unable to connect to my databases. When
I open WinMySQLAdmin, the "Server" group box on the Environment page is
completely empty (it used to have lots of server information in it).

How can I remedy this situation??

Mysql Fulltext Key Not Working
i created a table that uses full text search and the full text field is: FULLTEXT KEY client_search (name,city,country)

in my mysql query i tried running this query but i got no results although there is a value in the field called "john" as the name for the client.

selet * from client where match (name,city,country) against ('john')

the above query returns 0 results set, although i have a client called john under name.

Code:

XAMPP / MySQL / Not Working
I installed XAMPP on my MAC Powerbook G4, running OS X 10.4. It all installed fine and I can see it in the applications menu. In there is also a script "mamppstart", when I click this I get the following message:

Starting XAMPP for MacOS X 0.5...
XAMPP: Starting Apache with SSL (and PHP4)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for MacOS X started.

I'm assuming that's good and means that everything has installed and running, however I try to locate MySQL in the Terminal and get nowhere. Also when I click my MySQL preference pane it says there is an error.

MySQL REGEXP Not Working
I have a PHP script that uses MySQL (v3.23.53-max-nt) REGEXPs,
and these seemed to be working fine until it needed to use the
condition:

msg_text REGEXP 'status: (failed)'

I knew there was a record containing this string. But the script
didn't return it, until I had reduced the condition to:

msg_text REGEXP '(failed)'

The problem seems to be caused by the colon, despite this not
being a reserved character (as far as I can tell from the MySQL
manual).

Also, the manual says that preceding special characters by ''
causes them to be treated as normal characters. So why in
that case does MySQL complain about 'unbalanced brackets'
when I tried running:

msg_text REGEXP '(fail'

Luckily, I was able to work round these problems by using
a LIKE clause instead.

MySQL 5: Working With Old Scripts
I installed the version 5, locally, on my computer Windows XP. The reason was to try some scripts using MySQL. Now, I have seen that no script is apparently working with this version 5. Not else phpMyAdmin, that returns to me the following: #1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client...

Where the error is? Something I didn't worked well, or something else?

Mysql Asp Delete Not Working
i have a script in asp connecting to mysql with a simple delete query:

DELETE * FROM table WHERE id = 48

the table exists, the row exists and it is an integer why doesn't it work?

error below. Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM table WHERE id = 48' at line 1

/cfb-internal/dbase.asp, line 41

PhpMyAdmin Not Working With MySQL 4.1.7?
It says authentication error.... client not support the current authentication requested by the server, please try upgrading the client. I used the latest version of phpMyAdmin but it doesn't work. MySQL works fine on command prompt and root (password set) account works fine.

MySQL To Excel Not Working
I am a frequent reader of these forums, but this is my first post, so bear with me.
The problem I'm having, in the nutshell, is that I have a PHP script that takes a MySQL query, and dumps it to a properly formatted Excel (xls) file. When the query is reasonably small, it works like a dream. However, when I do a SELECT * basically, the file is still created, but its empty. Any ideas of what could be causing this behavior?
P.S. I have made sure that php.ini has more than enough accessible memory to do this.

Simple Mysql Query Not Working
I have a simple table set up listing stockists and there details, included in this table I have a name column and a website column.

I wish to select the name and the website of the stockists only if a website has been entered into the website column.

Here is the query I have tried to use
Quote:

SELECT name, website FROM stockists WHERE website IS NOT NULL ORDER BY name ASC

This query is returning stockists with no website as well as the ones with websites and I don’t know why!



WAMP Upgrade - Now MYSql Not Working
I have been running WAMP on my local server for sometime but I needed to upgrade so I downloaded the latest version, stopped WAMP and installed the new version. The Php is working ok but the MySQL service won't start and I even tried starting it in the Services. When I browse to MyPhpAdmin I get this error:

Error
MySQL said:

#2003 - The server is not responding

Working With The Text Datatype In Mysql
I am managing a small database where a few fields are defined as being of
type text. In my understanding, this would allow the user to enter up to
about 65,000 characters in the text field.

However, if the user types about 2,000 characters, then nothing is entered
in the database. I have checked the max_packet_allowed and the
net_buffer_length and the limits are quite high.

Could somebody advice me on how to go about solving this problem?

"I think there is a world market for maybe five computers."
Thomas Watson, Chairman of IBM, 1943.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=...sie.nctu.edu.tw

Working With The Text Datatype In Mysql
I am managing a small database where a few fields are defined as being of
type text. In my understanding, this would allow the user to enter up to
about 65,000 characters in the text field.

However, if the user types about 2,000 characters, then nothing is entered
in the database. I have checked the max_packet_allowed and the
net_buffer_length and the limits are quite high.

Could somebody advice me on how to go about solving this problem?

I look forward to hearing from you soon.

"I think there is a world market for maybe five computers."
Thomas Watson, Chairman of IBM, 1943.



Copyright © 2005-08 www.BigResource.com, All rights reserved