I have few hundreds of databases generated by different tools and archived in a central area. All the files are stored in zipped format. I tried importing those databases into mysql server by creating soft links in the var directory, but i dont see any tables in mysql. I can see all the tables if i unzip the files.
Is there a way to link the zipped databases?
No, you can't directly have mysql read databases from Zip archives.
If you are using Linux then you can install the fuse-zip filesystem (and Fuse if it's not already installed). This allows you to mount zip files as if they were filesystems. Point MySQL to your mount path and it will recognize the contents of the zip file(s) like any other file on your system.
http://code.google.com/p/fuse-zip/
It should go without saying that there will be a performance penalty but considering these are archived databases I'm guessing that's not an issue.
Related
What do I have to do to these files so that I can copy and paste the files into another program using only default windows functions? Copying and pasting it directly leads to an unstable database and the data within each table does not transfer.
As we answered in your other (nearly identical) question Export table from Xampp MySQL from file directory, this is not recommended and can lead to inconsistency. I could repeat here what I said there, but the answer is the same: if the MySQL service is stopped and if the entire datadir is copied and replaced, and if the MySQL versions are similar enough, then you might be able to accomplish this...but it's not supported and not recommended and you're much more likely to lose data than have success. File-level backups are not recommended for MySQL databases, you should export to an SQL file.
I would like to add more freespace to storage mysql tables.
I have tried use symbolic links with curlftpfs/sshfs (first create table, then move to ftp and add ln -s) but mysql gives me error "Operating system error number 95 in a file operation." on start.
I have VPS and FTP server (with SSH access), I would like connect remotely FTP space to my VPS which will be used to store ibd data.
Data tables must be store only on external server, not on VPS.
I am using InnoDB engine, 5.5.50 Mariadb, centos 7.
Do you have any ideas how to do it?
Thanks
Choice 1: Bigger disk drive. Some OSs allow dynamic addition of drives to add space.
Choice 2: If the OS can see another drive, you may be able to ask MySQL to put certain files on that drive.
No, you cannot use FTP or other "remote" mechanisms.
I'm a beginner here and I can't seem to find the files. My professor wants me to send these files specifically to her, but when I "export data" from the workbench, it only generates .sql files. Where do I get the .myd, .myi and .frm files she's looking for.
Thank you
Don't worry about those. That's just how MySQL stores the data internally. If you read the documentation carefully you'll soon learn that you shouldn't depend on those files for backups anyway, they're likely to be in an inconsistent state if the server's running.
The best way to make a backup for small to medium-sized databases is the mysqldump command. There's a number of options that can be applied but the most important on a busy database is --single-transaction which produces a consistent point-in-time snapshot.
The SQL data you get from that, which can be saved to a .sql file, is sufficient to recreate the database and is a backup.
You can restore with the mysql command-line tool, or if you're not comfortable with that, the MySQL Workbench program.
Somewhere there is a data directory under a directory with MySQL in the filename, and under data is your own database directory. Files are in there. But if you haven't used MyISAM as the table format, the files will have different extensions, e.g. .idb for InnoDB.
You can find it via the query mentioned in #tadman's comment, or from a shell:
find / -name data -print
although you will probably get a number of matches.
You will have to stop the MySQL server before you can copy the files.
I'm having trouble with my Mysql and Apache server here for a week already. Tried to look for every possible solutions in the internet like changing ports and everything. Still no luck. I would like to reinstall Xampp, the problem is, I have important databases which do not have any backups yet. Is there a way to backup these databases without having my apache and mysql started?
It depends a bit on the type of storage engines you're using.
MyIsam
MyISAM tables are stored as files, so it is easy to do a backup by copying files (*.frm, *.MYD, and *.MYI files). In a typical XAMPP installation they can be found under c:/your/path/to/xampp/mysql/data/ .
InnoDB
Have a look at the manual:
Copy all InnoDB data files (ibdata files and .ibd files) into a safe place.
Copy all the .frm files for InnoDB tables to a safe place.
Copy all InnoDB log files (ib_logfile files) to a safe place.
Copy your my.cnf configuration file or files to a safe place.
However, if you have important databases, it is advised to think about a backup strategy before problems occur. MySQL offers a variety of backup strategies from which you can choose the methods that best suit the requirements for your installation.
Yes, you can just copy the data files. for innodb you need the ibdata1 (or similar) file. For MyISAM you will see 3 files (different extensions) for each database and the filename match the database names. If it is MyISAM then you can just copy these files back into the data directory on your new install and it will just work.
The other thing you should do is not use WAMP! It is easy enough to set up from scratch and much easier to figure out when things don't work.... you just need to read a little bit.
Copy all the files in your htdocs to another location first, duplicate the database organizers from information envelope and erase xampp then re-install it. You also need to delete the ib_logfile0, ib_logfile1 files from the data folder inside mysql folder.
Read here for further procedure https://dba.stackexchange.com/questions/3437/lost-tables-in-drupal-site-database
I'm not sure if this will make sense, but I'll give it a shot.
My hard drive went down and I had to reinstall the os along with all my webserver configuration,etc. I kept a backup of the mysql database, but it doesn't contain all the tables...I added a couple tables after my last backup.
I have access to the hard drive and the directory where the mysql data files are stored from the failed hard drive, but I don't know how to retrieve the data into my new mysql database. Is it even possible to get the raw data files from mysql and load them into a different instance? I'd even be happy if there was some way for phpmyadmin to show the data files, then I could dump out to a backup txt file, and reload them into my new configuration.
Any help will be appreciated. thanks.
well, bad news...I can't access the drive anymore. As I tried to copy the files the drive went totally down. So, I'll just redo the couple tables. Thanks for your help anyway.
Although not recommended or reliable, it is possible to simply copy the data without using mysqldump. It might help if MySQL was shut down in a controlled manner (which does not appear to be the case) and the source and target environments are as similar as possible in terms of lib and MySQL versions.
The datafiles should be compatible - you can copy the data directory to ubuntu, and edit the /etc/mysql/my.cnf to point to the new directory.
The only catch might be where ubuntu being case sensitive effects the tables.