Copy of innodb /data dir not working - mysql

I successfully installed fresh 5.6.27 mysql through homebrew.
Now I want to restore innodb databases from previous mysql install. I copied data/ dir from the old one to a new one. It contains ibdata1, ib_logfile1, ib_logfile0 and all databases as directories with the tables .frm as well as .ibd files.
my.cnf are same in both installs.
However the new 5.6.27 is not loading databases after the restart.
Any tips?

Ok, I found that this brew install did set up data dir at /usr/local/var/mysql.
ps auxww|grep [m]ysqld helped to reveal that.
So I just copied there, restarted and voila, dbs are there.

Related

Restore MySQL datatabases from the /var/lib/mysql backup

my database server crashed on ubuntu 20.04, but unfortunately my database folders were containing only the .ibd files. the /var/lib/mysql folder was copied, then mysql was re-installed. I have followed so many answers on how to restore the databases here but nothing seems to work

How can I reinstall mysql while restoring DBs without mysqldump?

I'm running MySQL v5.7.25 on Ubuntu 16.04.5. Recently I noticed MySQL was not responding to any connects or service restart. I want to just purge the server and reinstall it but I have databases I want to retain and I can't use mysqldump to save them as sql files because I can't connect to mysql.
Is ther a way to do this, restore the files in /var/lib/mysql after a purge / reinstall. I've all ready archived the contents of /var/lib/msysql in a tarball, I just want to know if it's just a simple matter of copying the backedup files into the /var/lib/mysql directory before I pull the trigger.
don't use purge it removes everything. instead use remove
/var/lib/mysql folder stays untouched when you remove by using apt-get remove. D

must re-install WAMP, but want to save my MySQL databases

After installing a newer version of WAMP both WAMP-Installations won't start anymore. I can't figure out why and don't want to waste more time with it as I have to work on a project.
I would like to uninstall WAMP and reinstall again. How can I save all MySQL-Databases? PHPMyAdmin won't start. I see the database data seems to be in folder C:\wamp\bin\mysql\mysql5.6.17\data
Will it work if I just copy that folder, uninstall, reinstall WAMP and copy all data back from that folder?
Of course I would also copy all data from C:\wamp\www before uninstalling WAMP.
Any help is appreciated.
Milan
Take backup of /var/lib/mysql/<your database>
Reinstall WAMP
Restore <your database> back to /var/lib/mysql
Change ownership & group to mysql by chown -R mysql:mysql /var/lib/mysql/
Start MySQL

How to restore full mysql (dir)

My problem is: I'm saved the /var/www/virtual and the /var/lib/mysql directories. And after reinstall OS I set up the MySQL and when restored these two directories i'm got error in mysql server. So MySQL server don't want to start up.
So what way can i restore the mysql database directory?
The MySQL server don't start after I copy the ibdata1 file.

How do I restore MySQL DB from backup

My server recently crashed and I have backed the Mysql files using raid.
BACKED UP DIRECTORY
/backup/var/lib/mysql
I installed new OS(RHEL5.3) to my server and I want to restore my DB to MySQL
How do I do this?
I know you can ssh mysql > the dump files
but, these backed up files are not in DUMP.
They are separated as .MYD .MYI .frm etc..
I guess your backup file is not in the same server as your database.
Try:
scp -r /backup/var/lib/mysql/* DB_SERVER:YOUR_NEW_DATABASE_DIRECTORY
Then
ssh DB_SERVER
.. restart your mysql daemon (easier)
.. or flush privileges, flush tables ...
Copy these files directly to your mysql data directory, and you will be able to access them in MySQL. That should help you!