Database is disappearing from phpmyadmin - php

We've build an application using wampserver, PHP and MySQL. We are working offline in the meantime for funds reasons and can't upload it online with a dedicated IP address. Each few days, we receive a PHP error on the LOGIN page saying that there isn't a database named X.
We went to the phpmyadmin and the shock was that the database isn't there.
We tried to see if it is hidden in the config file of PHPmyadmin, but it isn't.
Then, we deleted ib_logfile0 and ib_logfile1 from the mysql data bin directory, and after restarting the computer, the database appeared again normally.
After few days, the same thing happens. We deleted the both files but this time the database didn't appeared in wamp. We glad that we backuped the data last time, but there is a full week data that may be lost now.
What is the problem ? Is it a computer virus or wampserver needs to be installed again ?
Error:
#2002 - No connection could be made because the target machine actively refused it. — The server is not responding (or the local
server's socket is not correctly configured).

Related

Connection to database when changing from online to local server (wordpress)

I'm starting to get crazy with this.
I have to do some modifications to a wordpress website that i didn't create. I have access to the hosting so I downloaded all the files and a copy of the database.
After creating and importing in the local database I went to wp-config.php and change the hosting parametres (user, pass, server,...) for the local ones.
But here comes the troubles. When I change the online server dbXXXX.db.1and1.com to localhost it suddenly stops working and files called index.php won't ever work again
(I get "localhost server not found" error),
even if I change the source folder, or restart MAMP or restart the laptop... The only solution is to unistall MAMP, restart the system and install it again, but when changing the name of the server to localhost it happens again...
Well... If I copy the content of index.php in another file (for example index2.php) and set the parameters to the online server it works again until I change server to localhost.
When I say "it works" means that at least I get "error database connection" from wordpress (due to the online hosting does not allow external requests to its databases).
Can somebody help? Do you need some extra information? Thanks!
MAMP did some crazy this on my PC to, so I decided to switch to WAMP -
http://www.wampserver.com/en/
You may give it a try ?!
Finally I found the error. It's due to the file ".htaccess" that Wordpress (or I don't know who) creates for using permalink and MAC OS X.
When unzipping the web downloaded from the hosting the OS deleted that file because only system files can start with a dot (".htaccess").
I didn't find the solution and just start to work in Windows with BootCamp and all was fine. I was in a hurry to finish this job so I didn't have more time to try new solutions.
So I have not the solution but the source of the problem. Hope this helps someone at least finding the problem and save some time.

MySQL Abruptly Refusing Remote Connections

UPDATE
So I completely disabled my server's firewall and it appears to be the culprit. I had tried to disable certain rules before but disabling the whole thing worked. Very frustrating, but problem solved I guess... I think the key indicator that it was the firewall was because it happened at exactly midnight when my server likes to apply updates and such.
This is pretty strange to me, I have a server downstairs that hosts my websites and MySQL servers and it has been running for years without many issues. I have 2 routers bridged together behind my modem and my server is behind one of them. All other devices connect via WiFi. All of the proper ports are open on the router and I have users configured in MySQL that haven't changed and have been working fine this whole time.
So last night I was working on a project and I decided to sync everything with a backup on my SkyDrive. I have a scheduled backup for MySQL that runs at midnight (daily) and it just turned over to midnight so I decided to open my network and watch the file get populated before I sent a copy to my SkyDrive. After the backup was complete (which it did successfully), I was going to continue to work on my program but all of a sudden I can no longer connect via my local network to the MySQL server. I'm using PHP and my connection string never changed and all other MySQL admin tools don't connect. The live site works fine, so MySQL was definitely running and working but no remote connections were being accepted. Why is this happening all of a sudden?
Things I've tried :
I did notice that my logs were packed full of BINLOG errors so I turned off the binlog since I recently turned it on (a couple weeks ago).
Restarting MySQL
Turning off Windows Server 2008 firewall (temporarily)
Connecting from a different device (mobile phone, tablet), no luck
Temporarily allowing port 3306 on my router
Checked server logs for intrusion attempts, none present...
Setup :
PHP 5.4 on local machine and server
Windows Server 2008 Enterprise (on server...)
MySQL Version 5.5.25a
Does anyone have any clue as to what's going on here? I'm going to reboot my server when the load is low and see if this helps any, I will update this once it comes back online.
So I completely disabled my server's firewall and it appears to be the culprit. I had tried to disable certain rules before but disabling the whole thing worked. Very frustrating, but problem solved I guess... I think the key indicator that it was the firewall was because it happened at exactly midnight when my server likes to apply updates and such.

No database selected on PHP MySQL

Error: No Database Selected
I have a website that was hosted with ARVIXE (windows 2008 server) and presently with IXWEBHOSTING (windows 2003 server). It was very simple to move. It was a matter to just download/upload the site PHP files and export/import MySQL database and change the config PHP file to point to the new
database information and voila!
Now I am trying to move the site to my own server. Trust me I have no problems with DNS, servers, networking stuff. I've being doing this for 15 years (not programming).
This is my actual server: Windows 2003 STD SP2, IIS6, PHP5.2.12, MySQL 5.0.96, FastCGI 1.5. and all MS Updates.
Now here me out before you conclude that is the code or MySQL permissions... I have read I think all the No Database Selected errors on the Internet including here and is usually a little code modification or missing code or permission issue on the database...but not this one, see the scenarios below and you will see why not.
Scenario 1
PHP Files are sitting in the IXWEBHOSTING servers. The config PHP file points to my own MySQL server it works fine.
Scenario 2
PHP Files are sitting in the IXWEBHOSTING servers. The config PHP file points to IXWEBHOSTING MySQL server it works fine.
Scenario 3
PHP Files are sitting in my Win2k3 servers. The config PHP file points to IXWEBHOSTING MySQL server, I get error "No database selected".
scenario 4
PHP Files are sitting in my Win2k3 servers. The config PHP file points to my own MySQL server, I get error "No database selected".
So I know for a fact it has nothing to do with MySQL permission on my own MySQL server or PHO code as scenario 1 proves it. It seems to be a problem with PHP on my server.
Prior of installing the OLD PHP and MySQ, I had the lastest version of each PHP 5.3.13 and MySQL 5.5.25 and same FastCGI version. I had the exact same problem!!!! The reason why I installed the old versions is because I wanted to match IXWEBHOSTING server versions.
Prior to the above installations, Windows was installed from scratch each time on a hyper-v server. No updates MS updates were done on the server the first attemps and the last installation it has all the MS updates and I still have the same problem.
I had the same problem with Windows 2008 STD, PHP 5.3.13 and MySQL 5.5.25.
PHP is loading all the proper extensions to make the connections to MySQL. I also have PHPmyAdmin running without problems.
I also tried with in the config file and no luck
There is a lot of stuff in the index but this is what is needed to make the connection to the database and the query and where it fails.
config file
<?
$usuarios_sesion="youth";
$host="localhost";
$user="usernamehere";
$pass="passwordhere";
$db="databasehere";
$tabla="users";
?>
Index.php File
<?
require ("enlaces_config.inc.php");
$menu=mysql_query("SELECT id_cat, name_cat FROM categories WHERE access=0 AND published=1") or die ("Can't select categorias MySQL says: ".mysql_error());
?>
At this point I have no idea what else it can be... permissions, maybe but not in MySQL permission, the user has full priviledges to the database. Scenario 1 and 2 proves it too.
If you need to check PHP information let me know. I will post the name of the php file for excution
Help!
The problem is not with all that you have written w.r.t your server.
When you try to fetch data from a database you must essentially follow these steps-
Create a connection
That involves connecting using Database, User Name, and Password, along with Hostname. You can use mysql_connect(), although deprecated.
You need to select the database from that host.
You go for any mysql query using selected db connection in step 2.
I would suggest you to get a good grip on database concepts first and then implementation using php.
Best place to start http://w3schools.com

whats meaning of "Error establishing a database connection"

i have one wordpress blog name as
http://shareprogrammingtips.com/
its hosted on hostgator and works fine. But suddendly i am getting error like
Database Error:
Error establishing a database connection
when i open my blog.
i have not done anything with php my admin of my webspace. i havent touch any setting still i am getting this.
why this error comes and how can i remove that ?
Chances are there is an issue with one of the following:
The database server is down (try connecting via a MySQL client such as PHPMyAdmin or the MySQL admin tools http://dev.mysql.com/downloads/gui-tools/5.0.html)
Incorrect username/password
Your username/password is correct however you don't have permission to connect from your current hostname (e.g. database only allows local connections).
You specified a database table that does not exist.
If you have't changed anything in the site wp-config.php or in Wordpress at all, it's probably nothing more than a temporary glitch at your webhost. Open a ticket with them.
Hostgator places a limit that database can consume only 25% of total memory assigned to a hosting account. You have mysql server going away that crashed your server.Kind of "Memory Issues" if it is repeatedly occuring the hostgator support will finally ask you to upgrade

Can't connect to local MySQL server through socket '/tmp/mysql.sock'

I don't know what's wrong with my website since I last upgraded it to new version of PHP Melody: http://www.juraatmedia.com/
Is this some script issues or server issues? Please check and reply asap. Thanks
(I am using NetworkSolutions hosting, I don't know whether mySQL server is running or not. I tried opening phpmyadmin for the specified db, it's opening but when I am clicking on my db on the left, it's just loading and not showing anything. Does that suppose to mean that mysql is not running? I tried contact them via email but they said I have to call their technical team. This is happening since saturday, how come their server is down since 2 days)
If your db config is looking to connect on localhost, change it to 127.0.0.1 (I know it's the same but it somehow it acts differently). I've had that problem before with an upgrade. Was getting that error changed the hostname to an ip address solved my problem

Categories