Mysql how to backup and restore after version 5.5 - mysql

The mySQL manual says that backup and restore are deprecated, and removed in version 5.5.
I have ISAM tables dumped with "backup" from an earlier version (5.0) - how can I restore these to a 5.5+ mySQL database.

I would copy the *.MYD and *.frm files into the target database directory, and then run a REPAIR TABLE on each table (so as to rebuild the indexes).
The "target database directory" is datadir/dbname where datadir is a server parameter, and dbname is your target database name.
datadir is found with the SQL command SHOW VARIABLES LIKE 'datadir';.

I dont mean to sound snarky, but older versions of mysql can be obtained. Why not install a copy of the older version of mysql, export to SQL using mysqldump, then reimport into a newer version.
Perhaps use a virtual machine inside Virtualbox.

Related

How to restore database files after update 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

How to move MySQL 5.6 server data to another one not depending on dump command?

I installed Windows 10 yesterday and couldn't back up my MySQL database with admin commands. But Windows 10 installation didn't remove the old files. So I can access the old MySQL server directory with those files. Is there any way to move data moving files to the new MySQL's directories?
For more information, I am using MySQL 5.7 server and the previous version was 5.6. But If there is a way, I can downgrade the new version to 5.6.

Import MySQL 5.6 Database in ProgramData dir to MySQL 5.7

When I was installing MySQL 5.6 if, there was a option to choose your MySQL database dir (I guess). I chose that option and set it to D:\ProgramData\MySQL\MySQL Server 5.6. I was hoping that there would be the same on MySQL 5.7 installation but there is not.
So, how to import the MySQL 5.6 database to 5.7?
There are several ways. Best one is to always have a full dump of the database in case you need to regenerate from zero.
Other way is to allow mysql installer to do the upgrade. If the installer fails to take the previous datadir, you can manually specify it modifying the my.ini config file.
Search for an entry, which should look like this:
# Path to the database root
datadir=D:/ProgramData/MySQL/MySQL Server 5.6/Data
Hope this helps.

How to restore MYSQL database after installing a different version of WAMP?

I would like to know How to restore MYSQL database after installing a different version of Wampserver. The explanation is as below:
I deleted the wampserver folder accidentally and I lost my MYSQL database. However, I have succeeded to restore the data folder that contains the database and I have installed another version of Wampserver (Actually, the old version of MYSQL that I was using was 5.5.8 , and the MYSQL version that I am using right now is 5.6.17) and I have tried to restore the database by copying its folder and putting it and the old ibdata1 file under the data folder of the new installation. But, unfortenately, that doesn't work.
So, my questions are:
Is it possible to restore MYSQL database after installing a different version of Wampserver (with a different version of MYSQL)?
If yes, how can I do that? What would be the solution?
In the past when this has happened to me, the only option that worked was to reinstall an older version of WAMP (i.e. MySQL) to match what my databases were created in originally.
If you install the same WAMP again, copying the folder should work now.
If you can gain access to your databases at this point, then you can do a proper backup of them using phpmyadmin or mysqldump etc.
After you get a proper backup, remove the older WAMP version and install the latest version again. Now you have to restore the databases using the backup files in order to put them into the newer MySQL version.
If you backed up your database you can restore it using your backup file. If you are using a graphical interface for mysql like PHPMyAdmin there is a import button you can use to import your .sql, .csv, .zip, or what ever extension you used to backup your database.

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.