How to restore database files after update mysql - mysql

I'm using laragon for my project, today (unfortunately) y has a problem with my SSD (C:) and I have to format all, my project was located is D:\ but MySql was not working, I updated from MySql 5.7.24 to 8.0.23
before doing that, I have saved database files and old MySQL files, now I don't have my database, my localhost is empty
I have files in .frm, .ibd from the database (my tables) and I have my old MySQL files (.MYI, .MYD, .frm, .ibd, etc)
How can I restore my database in mySQL-8?

Your question is not clear. However, you can:
Back to MySQL 5.7.24
Dump your database to a sql file
Switch to MySQL 8
Restore from the dumped sql file
Note: If you have no purpose to upgrade, you should go with MySQL 5.7

Related

How to open database folder with .ibd file extension in it in mysql workbench?

I deleted the mysql server and then I lost all the connection in my mysql workbench.
And I figured out how to get the database of those connection.
Finally, I got in the directory, C:\ProgramData\MySQL\MySQL Server 8.0\Data\{databasename}.
Now inorder to restore the database I could see different ways but I cannot find how to open this database in which folder there are all the tables but with .ibd extension.
I need help how to open this db folder in my mysql workbench.
Here is the screenshot of the files.
UPDATE:
After deleting the mysql server 8.0 I downloaded the mysql server 8.1 and now I could see databases in 2 other directories.

Migrating data from older mysql installation to new one in mac

I had mysql version 5.7.12 in my macOS High Siera full of database files stored in /usr/local/mysql-5.7.12-osx10.11-x86_64/data directory. Then I updated mysql to 5.7.23 and a new directory is created as /usr/local/mysql-5.7.23-macos10.13-x86_64/data in which the upgraded mysql expects the database files to reside. Can I simply copy the database files from the older directory to this one and restore my data? I don't want to export the databases and import them back.
Here is how I did it.
Stopped mysql
Copied all the database file/directories and a file called ibdata1 (the tablespace for InnoDB) from the older data directory (/usr/local/mysql-5.7.12-osx10.11-x86_64/data) to the new one (/usr/local/mysql-5.7.23-macos10.13-x86_64/data).
Granted necessary privileges to database users.
Started mysql and everything comes back.
[P.S. I need to do this because the database files are multiple tens of GB in size and I don't have the necessary disk space to backup and restore.]

Can I open a mysql 5.1 database from mysql 5.5?

I have a MySQL 5.1 database (The data files in F:\ProgramData\MySQL\MySQL Server 5.1), but I'd like to open the database from MySQL 5.5 on my new computer. I don't have MySQL 5.1 running any longer because my old computer's motherboard failed, and all I have is the hard drive where my 5.1 database resides.
Is there a way to open the old MySQL 5.1 database from MySQL 5.5?
I should add that my database is InnoDB (I think). I had another database that was MyISAM and I was able to open it in MySQL 5.5 just by copying the old database directory over to the new MySQL data directory.
In the Linux world you can simply copy the file system /var/lib/mysql/[yourdbfolder] into the new file system. You then have to run mysqlcheck --repair but all should be good after that.

Import MySQL tables recovered into new MySQL Database

I have the data files of an old MySQL database (.frm, .MID, .MYI), taken from a server hard disk.
No way to be sure about MySQL version: I have no access to the server, I only know the server was a linux machine, built in 2009 or 2010, and then left alone without maintenance.
I downloaded and installed the last MySQL .MSI, but I'm totally new to MySQ.
The first step I need is importing my data into a new MySQL database, and then with a Delphi program I plan to move the data into a SQL Server DB.
How can i import these data tables?
Yo can stop mysql server, create some folder like old_data in mysql data directory, put all your .frm, .MID, .MYI files there and start mysql. After doing so you should be able to see old_data database in results of the SHOW DATABASES command.

How to recover Mysql database from backup files

I have using VPS that had to be re-imaged. my DB was part of it and it was being backup up as the app wasn't in production yet. However, there is some data that I wish to recover on it. the VPS provider is giving me a backup of the image (Ubunto Linux) that has all the files.
Is there a way I can recover my data?
The mysql data files in Ubuntu are located at /var/lib/mysql
To restore your database you need:
1) create new database named as old one
2) stop mysql server
3) copy old database files from /var/lib/mysql/your_database_name/ to new system
4) start mysql server
Your database will be restored.