Can't export MySQL database with PHPMyAdmin - mysql

I have a MySQL 5.5 database in a web hosting, which I access using PHPMyAdmin (the hosting provider doesn't give me shell access). I back the database up using the "Export" function in PHPMyAdmin.
Recently, however, whenever I try to run the backup, I get an interrupted DB dump, and I see in it a PHPMyAdmin backtrace saying that "MySQL: the server has gone away". The two solutions to this, as I understand it, are:
Changing the "max_allowed_packet" parameter in the server... but I can't do that.
Repair tables... but I checked the status of the tables in the DB, including the ones where the dump usually stops, and they all seem OK.
I can always back it up in chunks, but it's a hassle to do that when the DB has about 40 tables. What can I do to fix this?

Related

phpmyadmin shows tables in the sidebar but tables don't exist

I re-installed wampserver 2.5 (with same stuff/settings - nothing changed) and after installation my database got corrupted. Few database tables exist and many of them are not accessible. On right frame it shows No tables found in database.
Even the sidebar of phpmyadmin shows my database table
but when I try to open any table it says:
To confirm whether tables exists in database, I go to
C:\wamp\bin\mysql\mysql5.6.17\data\db_blog
where I can see a long list of stuff. My tables are listed in 2 different formats frm and idb.
How can I repair my database? Please help me.
Before reinstalling wamp you should have done backup of database and after reinstall bring database back from backup. If after reinstall of wamp database is still available but seems to be corrupted then there you did something wrong with wamp reinstall as database should be purged or not touched, nothing in between. Now everything depends on what you want to achieve: you can purge databases simply using phpmyadmin or try to somehow restore database but it is possible only if you have backup of database, otherwise data is corrupted and can't be restored. You may try to repair database by following this article but do not expect miracles:
https://www.a2hosting.com/kb/cpanel/cpanel-database-features/optimizing-and-repairing-mysql-databases-with-phpmyadmin

Connecting my MySQL databases to phpMyAdmin

I am running Mac OS 10.10.2. I have recently been educating myself about php and SQL in order to create an online database application for my employer. However, I have been unable to load up my MySQL databases in phpMyAdmin. I have tried following some advice from this forum, but no answers seem to solve my issue.
I installed MySQLWorkbench (Ver. 6.2.4.12437) as well as XAMPP (Ver. 5.6.3-0), and was using phpMyAdmin to have a play around and better understand what I was getting myself into. I then found one of those follow-the-bouncing-ball type teaching websites which advised me to download and install the MySQL community server (Currently running Ver. 5.6.23)
As instructed, I was learning SQL commands through Terminal and built up some databases/tables this way. I decided I wanted to jump into phpMyAdmin where I felt it'd be easier to continue my work. At first XAMPP was unable to turn on the servers which I overcame by uninstalling and reinstalling. Then I was getting a #2002 error when trying to access phpMyAdmin. I tinkered with config files and put in details relating to my localhost MySQL server (Or at least I assume as much).
I was able to get back into phpMyAdmin finally, but my databases made through terminal are not there.
phpMyAdmin shows: cdcol (the example database), information_schema, mysql, performance_schema, phpmyadmin, and test.
If I open terminal and punch in 'mysql' then 'SHOW DATABASES;' it only lists: information_schema.
If I open terminal and punch in 'mysql' with username 'root' and my password, then 'SHOW DATABASES;' it lists: information_schema, mysql, performance_schema, my tutorial/learning database, and my business database. I dropped the test database from here. THESE are what I want to bring up in phpMyAdmin.
I can only guess that I haven't got it configured properly to access this last mysql server, but I can't determine where I am going wrong. If anyone can shed some light on this, that'd be greatly appreciated.
It appears as if you have two MySQL instances; one from the XAMPP and also the MySQL Community Server that you installed yourself.
The "M" of XAMPP is for MySQL, so yes usually it runs its own MySQL server instance. That's sort of the point of the packaged kit, so you don't have to worry about having any of your own applications installed. In theory it should be no problem to stop the XAMPP MySQL instance and instead use your other one, but may require tweaking some configuration files and is probably not supported. If you can make it work, I don't see a reason why it would be a problem, though.
My suggestion is to either use the complete XAMPP stack or roll your own installation rather than mix and match.

Mysql Table corrupted after restarting PC

I am working on Symfony2 Project and am beginner in symfony Framework. I am using XAMPP as webserver. Everything is working properly until system restarts. When I restart my computer the tables of mysql database using by symfony project corrupts automatically.
I am using windows 7 professional 32bit OS.so, is there any problem in mysql?
MySQL tables can become corrupt for several reasons, such as hardware
failure, operating system bugs, viruses and bugs in MySQL. hMailServer
itself does not cause corrupt MySQL tables. hMailServer communicates
with MySQL over TCP/IP using a standardized language.
There's nothing in this language that can cause corrupt tables.
If a MySQL table becomes corrupt, you need to repair it. Note that repairing a corrupt MySQL table may lead to loss of data. It's therefore important to create a backup of your system.
How do you know whether a table is corrupt?
Examine the hMailServer error log. If you see a lot of Error while executing SQL statement-messages, then it's likely that one or more of your tables are corrupt. Feel free to ask in the forum if you're unsure.
Step 1: Determine MySQL password
If you are using an external version of MySQL, you should already know your MySQL password.
If you are using the built-in MySQL version that comes with hMailServer, you might not know your password. To determine it, follow these steps:
Run the script hMailServer/Addons/Utilities/DecryptBlowfish.vbs.
Enter your main hMailServer Administrator password. This is the
password you specified during the installation when you first
installed hMailServer. Click OK.
Open up hMailserver.ini, located in your Windows directory or
hMailServer bin directory.
Copy the database password from hMailServer.ini to the "Enter
encrypted password" dialog. In hMailServer.ini, you should see a
line looking like this: [Database]
...
password=c85dae3cb73394ab
In this example, c85dae3cb73394ab is the encrypted password.
Click OK in DecryptBlowfish to view your password
DecryptBlowfish will now show your password. Either keep the dialog open or memorize the password.
Step 2: Connect to the server
To be able to repair your table, you need to connect to the MySQL server using a MySQL client. You can use SQLyog for this.
Download and install SQLyog
Create a new connection.
Enter the connection information for your MySQL server. If you are
using the built-in server, you should enter hostname: localhost,
user:root, password:password from DecryptBlowfish, port:3307
Click Connect to connect to the database server
Step 3: Repair the table
Follow these steps to run the SQL statement to repair the table.
In the tree to the left, click on the hmailserver database.
The hMailServer database will now be active.
In the right part of the SQLyog window, click on the Query tab.
Enter REPAIR TABLE tablename, for example, REPAIR TABLE hm_messages.
Click on the Execute Current Query button in the toolbar (or select
Edit->Execute Query->Execute current query or press F5).
MySQL should now repair the table. After the table has been repaired, restart the MySQL and than the hMailServer service. Depending on what table is corrupt, a restart of the services may not be required, but we recommend that you always do it.
Source

MySQL can't connect - ERROR 2002 (HY000). Please HELP!

I was using mysql, trying to add some foreign keys to a database on a Debian server... and all of a sudden I started getting this message:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
No matter what I do, I get this message. If I restart mysql, it just spits this crap out a bunch of times.
I have rebooted the server a bunch of times, and it's not going away. I have no idea what I did... I was just changing the schema of a database that has actually been in production for over a year.
I recently changed the domain name of this server, but mysql was working for a few days after this change.
Beyond that, I can't think of anything I did differently.
Please help. I have to get this database back online.
EDIT: Joy, mysql corrupted my actual database by trying to add foreign keys into a freaking database. The database is toast.
Good thing I have backups, but this is unreal.
This seems to be a useful link. It suggests starting mysql daemon, then type mysql.
/etc/init.d/mysqld start
mysql
If that does not work check the config files for both your mysql client and server to make sure they are pointing to the correct locations.
It turns out that the database was corrupted. If you're also getting an error like this that defies reason, try showing tables and selecting data out of your basic default databases that comes with mysql just to be sure.
In my case, dropping and adding foreign keys actually destroyed my database, which explains why rebooting the server or restarting mysqld was having no effect.

phpMyAdmin crashing the MySQL host server

I have encountered this problem a couple of times, in the last few days. So, it happens occasionally. I have setup mysql on a remote machine, and there is a java program on another machine querying the database to read and write records every few seconds.
I am using phpMyAdmin to administer my database. And, at times, after running some SQL query, the mysql server stops responding. Even the pinging the host machine doesn't succeed. And, I have to ask someone with physical access to the machine to boot it up again.
I checked for log files but couldn't find them in the mysql directory. Is logging disabled by default? What is missing here? And, how can I go about troubleshooting this?
EDIT:
I was able to ping the server after some while. So, the server must have been temporarily busy. It's not a specific query but things like re-ordering the data of a table serially under the browse tab.
Use a mysqlclient to make a connection and keep it open.
I personally use the mysql from the commandline.
If the server becomes unresponsive execute
SHOW PROCESSLIST;
It will list all mysql processes and will show how long queries are waiting/executing.
Optionally use the KILL statement to terminate the query that locking the tables.
KILL $pid
I'd highly recommend using MySQL's own GUI tools for database management, for a vriety of reasons:
They have full support for InnoDB tables, including Foreign Key management
You can use database-level security to make sure only you get into your data (unlike phpMyAdmin, which at best can only be root access installed behind a .htaccess password)
It is official and supported. No extra binaries run on the server, so you run no risk of it crashing and taking the server down with it (unless your query itself is locking it...)