Linux / UNIX Tech Support Forum
This is a discussion on PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string within the Web servers forums, part of the Mastering Servers category; Hello, here is a little info before I ask for any help Database Server MySQL + CentOS Code: [root@centos home]# ...
|
|||||||
| Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello, here is a little info before I ask for any help
Database Server MySQL + CentOS Code:
[root@centos home]# mysql --version mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0 Code:
root@uploader [~]# php -v
PHP 5.2.9 (cli) (built: Nov 22 2009 10:22:42)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with eAccelerator v0.9.6-rc1, Copyright (c) 2004-2007 eAccelerator, by eAccelerator
Code:
root@uploader [~]# httpd -v Server version: Apache/2.0.63 Server built: Nov 22 2009 10:07:08 Cpanel::Easy::Apache v3.2.0 rev4891 Basically, the uploader server receives the file via Perl, and then perl redirects to another script in PHP to handle the inclusion of the file into the database,this process works fine, but sometimes, intermittently throws this error out: Code:
[04-Dec-2009 06:08:19] PHP Warning: mysql_insert_id() [<a href='function.mysql-insert-id'>function.mysql-insert-id</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 111 [08-Dec-2009 23:03:43] PHP Warning: mysql_pconnect() [<a href='function.mysql-pconnect'>function.mysql-pconnect</a>]: Can't connect to MySQL server on 'x.x.x.x' (113) in /home/x/public_html/adodb/drivers/adodb-mysql.inc.php on line 382 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 102 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 102 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 103 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 103 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 103 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 103 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 104 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 104 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 105 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 105 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 107 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/vureel/public_html/connect.php on line 107 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 108 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 108 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/x/public_html/connect.php on line 109 [08-Dec-2009 23:03:44] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 109 [08-Dec-2009 23:03:44] PHP Warning: mysql_insert_id() [<a href='function.mysql-insert-id'>function.mysql-insert-id</a>]: A link to the server could not be established in /home/x/public_html/connect.php on line 111 |
| Sponsored Links | ||
|
|
|
||||
|
Can you paste your my.cnf file? Do you use some sort of mysql query caching and acceleration?
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Sure Nixcraft,
Code:
[mysqld] max_connections = 4900 key_buffer = 512M myisam_sort_buffer_size = 64M join_buffer_size = 1M read_buffer_size = 1M sort_buffer_size = 2M table_cache = 2500 thread_cache_size = 64 wait_timeout = 3600 connect_timeout = 300 max_allowed_packet = 16M max_connect_errors = 1000 query_cache_limit = 4M query_cache_size = 48M query_cache_type = 1 skip-innodb [mysqld_safe] open_files_limit = 8192 [mysqldump] quick max_allowed_packet = 16M [myisamchk] key_buffer = 64M sort_buffer = 64M read_buffer = 16M write_buffer = 16M |
|
||||
|
How much memory do you have on this myql server? How many connection do you open at pick to mysql? MySQL needs lots of memory and fast disk I/O system. Try increasing the query cache, and buffers. See if it helps. If I were you here is what I will do to nail do the problem
Quote:
__________________
Vivek Gite Linux Evangelist |
|
|||
|
This is my main concern, the main site, which holds the application and handling all of the video views, etc.. also connects to that same database server, however, this little server always has issues connecting, it sometimes works flawlessly and somethings it will just have trouble connecting.
For the nobody user accessing the database, I would believe that because PHP was not able to connect to the remote database it is now trying to access localhost as a database. mtop shows this: load average: 1.14, 0.91, 0.60 mysqld 5.0.45 up 11 day(s), 20:52 hrs 101 threads: 1 running, 41 cached. Queries/slow: 137.8M/0 Cache Hit: 100.00% Opened tables: 0 RRN: 2.2K TLW: 2.6M SFJ: 0 SMP: 0 QPS: 160 |
![]() |
| Tags |
| errors , linux , mysql , php , unix |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Howto: PHP Block phpinfo() function | asim.mcp | Web servers | 4 | 25-10-2009 11:05 PM |
| [Solved] Help with execvp function in C program ! | demuytree | Coding in General | 3 | 17-06-2009 01:16 PM |
| fattach function which package | sathiya | Linux software | 2 | 02-06-2008 05:41 PM |
| Adding storage function to a mail server | satimis | Databases servers | 0 | 04-01-2008 01:15 PM |
| call function in bash | mala_un | Shell scripting | 9 | 18-08-2006 01:36 AM |