How to repair a specific table in prod database - mysql

I have a production database in which I have multiple tables. There is one table in which I store the server responses for the API calls which I receive.
Now that particular table is not working properly. I mean, the data is getting added into that table.
When I click on info button of the table, am getting the details which include number of rows and all. I can see that it's increasing. But the problem is that, whenever I try to execute any query on that table, my MySql workbench crashes.
I tried repair table indoor.ServerResponse; but again this query also doesn't work. It keeps on running and somewhere down the line, it freezes.
I just have few thousand rows in that table.
Now my question is :
1) How do I repair the table ? Did I lose it all?
2) How do I make sure that this doesn't happen in future? As this is the prod database.
3) I am also not able to Alter other tables in the database. But the queries run fine. Why is it so?
P.S. Am using MySql workbench.

Related

MySQL can't show table after altering auto_increment

I created two tables like this
and I want to change the added data's id so I use
alter table member auto_increment=5;
after this, it couldn't show my member table. It shows
error 2013: lost connection to MySQL server during query.
I thought my table is too big to run, so I changed the limit and the DBMS time out, but it didn't work either. Can someone tell me what's the problem now?
I found the problem. Don't edit your MySQL database when you're connecting it with your Python Flask program. Edit means any CRUD actions.

Export only the indexes from mysql database

I have a mysql database. For which I need to retrieve only the indexes present in my entire database, Is there any way I could get it? OR get a
CREATE indexes script which will help me do so.
I just don't want to SELECT them, rather I would like to get a script which when executed on similar database - the indexes will be added

Access Delete Query Deleting Tables on Multiple Databases

I am using access 2007. In the database I am using a delete query to remove data from a table. What shocks me is that even though I have create multiple duplicates of the database in several different locations and with different names on the same server PC, the minute I run the delete query it removes all other tables on the other databases which I do not wish for as they are backups.
Could someone please help to explain why my delete query is not limiting itself to one database.
Thanks
Found my answer. The database was broken up into a back and front end. Making duplicates of the front end still was linked to the original back end. Had to copy over tables from back end to front end to make the database a single entity again.

Mysql views return data when table empty

I am having a weird problem with mysql. I am developing a visual application on C# that stores data into a database. Previously I used SQL for the Database, but my client changed his mind for mysql. So I recreated the same schema on mysql. Now it is happening a really odd thing: My tables are completely empty, but when I execute the views, they return me back data from the old SQL tables, when I read directly from the tables they appear empty. The user that I use to connect are different and the most strange thing is that it happens even when I execute the view on mysql workbench. I have even truncated the tables in mysql and still the same thing. Does anybody know what may cause this anomaly and how to solve it?
p.s. Workbench version 6.2; Sql version SQL SERVER 2014
Regards.
In MySQL, a view is a virtual table based on the result-set of an SQL statement.
It contains rows and columns, just like a real table in your database. The fields in a view are fields from one or more real tables in the database.
When you execute the views, they return back data from the old SQL tables. It is because your view still contains the data you run a while ago. You have forgotten to Drop your View every time you execute it. To Drop a MySQL view, try this one:
DROP VIEW view_name
Views do NOT contain data of any kind -- except for Materialized Views and MySQL does not have those. If views had to be dropped and recreated every time a DML statement was executed on a table, views would be utterly useless.
The only time a view can return old data is when one process changes the contents of a table used in the view and the view is queried by another process before the first process commits the changes. You have not specified how the tables are being changed and how they are being queried. Nor have you included the create view statement. You could well be using other tables than what you think. This can happen during initial design of a database if tables are being slapped around like mad.

What is the size limit for a Query/View table in MySQL?

I am using MySQL and currently have 3 tables in a database. I created a view table with relationships between the 3 tables. The view table should be about 200 000 rows of data because i also tested the same query in Access and it works fine, but unfortunately i am not allowed to use Access.
When i build the view in MySQL i get a message that says the view was build successfully. But when i try to actually view the data, it gives me something like, MySQL ran out of memory. I am not sure what i can do differently to avoid this message. Can someone please give some advice?
You can use the Quick option for running your query.
Do not cache each query result, print each row as it is received. This
may slow down the server if the output is suspended. With this option,
mysql does not use the history file.