I have one database name - manaskavya. In this database I had created 10 table with xampp server. Due to some reason i installed Wamp server in that it was showing only 9 table, It misses one table name 'manas_likes'. Then I again installed the Xampp server but the missing table is not displaying, and when i am creating the new table with same name its, showing table exists, and when I am trying to drop it,repair it or truncate it, its showing table not exists.
I don't know why its happening , if you know please help me out.
Thank you
Once i faced the same problem. I tried Change table name in the create table query, exequte it and then rename the table. Then drop the table and recreate it.
After checking all these details I got some thing, I am right or wrong don't know but it worked for me..
1. When we create new table in database, its create one file with .frm extension
you can check this file in C:\xampp\mysql\data\database_name\anytable.frm
for wamp C:\xampp\bin\mysql\mysql5.0.2\data\database_name\anytable.frm .
2. After inserting data in this particular table it creates two more files with extension
.MYD and .MYI .
3.when we create the backup of the particular database..
If you are making backup with phpmyadmin then such type of problem will never be happen.
if you are making backup directly from folder means C:\xampp\mysql\data\database_name then some time it misses the .MYD and .MYI extensions files
4. After importing again in database there would be only .frm extension file, Due to absence of .MYD and .MYI extension file it becomes invisible. and it also won't allow you to create new table with same name because .frm extension file is already present in your database.
5. So in such type of case go to directly at folder position and delete that specific .frm extension file (Please be sure to delete the correct file).
6. Then after you will be able to create the table with same name.
Related
hi I have my database with the different folder in .frm and .ibd, I inserted this documents into current database folder that it is in var/lib/mysql/current_database the thing or the issue is that if I go to phpmyadmin and then I refresh to see if that new tables that I added before where uploaded, they will not display at all.
and this new table that I added is in same path where visible tables in phpmyadmin are.. example:
I can see users table but If I add rols table I do not see it even if it is same path so I wonder what can I do to fix it? what do I need to do to see in phpmyadmin or mysql database that new table that I added in var/lib/mysql/current_database
Thanks
I am doing a course on MySQL and we had to download a file to populate a database with data after we make the database, but the file is just "Export" on already made database and it has its own "CREATE TABLE IF NOT EXISTS" which means you can basically use it to create the database and populate it with data.
Here is the file https://pastebin.com/u1iWcQgx (its too big to just paste here)
What I am doing
1.Open phpmyadmin
2.Create new database cardb
3.Import the file
And here is what I get when I press "GO"
My problem is that even if I need to change something...why should I need to? I mean...nobody else got this problem and this file is auto generated so there must be no errros....I suppose it is something with the database I create.
[EDIT] I used HeidiSQL and it worked perfectly....which makes me even more confused as to what is the problem.
I deleted records in a MySQL table two days ago. Can you please help me to get back these records. I don't know how to repair the MySDL table.
Please help me to get back the deleted data and mention some way to create a backup for my MySQL database.
There's no "magical" way to restore deleted data, so :
To create a backup, you simply have to export the whole database in a file. This can be done easily with any database manager. Here is how to do it with PHPMyAdmin :
Click on your database (left pane)
Click on Export (top of the page)
Click on Go for a quick and full export
Keep the generated file in a safe place (ie. not in your website folder)
I have a MySQL Server which has one database called "Backup".
It only has one table with the name "storage".
In the Backup db the storage table contains about 5 Millions datarows.
Now I wanted to append new rows to the table by using the "source" command in the SQL command line.
So what happend is, that source uploaded all the new files in the table, but it overwrote the existing entries (seems that he first deleted all data)
What I have to say is that the sql file that I want to update comes from another server where this table has the same name and structure as "storage".
What I want is to append the new entries that are in the sql file to the one in my datebase. I do not want to overwrite them.
The structure in the two tables is exactly the same. I use the Backup datebase as the name says for backup uses, so that from time to time I can backup my data.
Has anyone an idea how to solve this?
Look in the .sql file you're reading with the SOURCE command, and remove the DROP TABLE and CREATE TABLE statements that appear there. They are the cause of your table being overwritten; what's actually happening is that the table is being replaced.
You could also look into using SELECT ... INTO OUTFILE and LOAD DATA INFILE as a faster and less potentially destructive way to get data from one server to the other in a file.
The files in which MySQL stores the table data don't seem to grow when I add data to the tables. They seem to start at 9k and stay there.
The context of this question is that I wanted to create a database on my fastest drive (which is not the drive on which MySQL is installed). I worked out how to do this by setting the datadir variable and this seems to have worked: when I create a new database I see a folder named for the database in datadir, and when I create a table in that database then the folder gets a new file called table.frm.
Is the .frm file not where MySQL stores the table's data? If 'no', then where is the data being stored? If 'yes' then why doesn't the file grow in size when I add millions of records to the table?
the .frm is the table definition file, look for the .myd (data) and .myi (indexes) files