MySQL Adding external space for storage tables - mysql

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.

Related

Where does the MySQL database store its data?

For SQLite, the program directly put the database information - schema/data into a file.
In command line prompt, it's
% sqllite3
So How about for MySQL database? Even for a local usage, I need to set up a client-server login to access the database. Anyway, the data has to be put somewhere on the disk to take some space.
More specifically, how to configure the MySQL data storage location? If I need to move the MySQL data to another directory or disk partition, how to proceed?
Change the datadir value in my.cnf file of your MySQL installation
If you are in Windows, probably you will find this file in C:\Program Files\MySQL\MySQL Server 5.1\my.ini or where ever drive your MySQL installation in
If you are in Linux, probably you will find the file in /etc/mysql/my.cnf
You could check here for more info

Gaining access to mysql given physical access to the machine

I own a machine running third party software. I input data into this software and it stores that data into its own mysql database. I'd like query the mysql database directly, but I don't know the credentials that the application is using.
I have read and write access for all files in the machine, including the files in the mysql data directory. Theoretically, I should be able to read the data directly from these files (.ibd and .frm files). But practically, I don't know where to start. I'm thinking that these data files are somewhat readable since encrypting them would destroy their index-ability.
Is this feasible? Or would I have to reverse engineer the data file format in order to read it?
Or even better - is there some config file that I can change which would implicitly trust all local connections similar to postgres?
You could read the mysql files directly, but even if they're now encrypted, the columns names might be weird and you could have to spend some time reading them.
Another point could be looking for config files from that software, that could have the login/password (very very low probability, but who knows?)
And the best would be:
make a backup of the mysql files
in another mysql instalation / computer (to not break your software), follow the reset mysql password guide
Try accessing it via the command line on the local machine:
shell> mysql db_name
(from MySQL documentation)
From here, you can create yourself an account if you need to connect from other client software.
Or have you already tried that?
If you have root access to the machine that MySQL is running on, then you can reset the MySQL root password by following the procedure at: http://www.cyberciti.biz/tips/recover-mysql-root-password.html. Once you've reset the root password, you can then login to MySQL as the root MySQL user, and access any of the databases, and query them. The only caveat to keep in mind is that changing the MySQL root password could potentially prevent your application from accessing the MySQL database, but that would be surprising as the application should be designed to connect to the database using a MySQL user account (with limited privileges) other than the root MySQL user.

How to make a "portable" MySQL InnoDB database?

I need a single InnoDB database to be used by a Linux and a Windows MySQL installations (as I boot my PC to Linux or to Windows). Would be great if I could move the same database to a different PC. Importing/exporting data is hardly an option as the database is huge (over 4 GiB - easy to copy, but pretty long to export/import). How can this be achieved?
You should then install the MySQL database on the windows partition, and get the path to the database folder
In Linux, MySQL saves its data in "/var/lib/mysql/" so go there and create a symlink to the folder in the windows partition using the following command
ln -s /path/to/database/on/windows/ /var/lib/mysql/databasename
you need to be root to run this command, or use sudo.
This will make the MySQL server on both Operating systems see the same database folder.
NOTE: you should do some testing to check if this is a reliable solution, and if you are doing a mission critical project you should follow a more reliable setup.

Back up MySQL using phpMyAdmin

I have used MySQL for my application written by PHP. After a time its data will be great and I need to make a backup from them. Also, I need I can restore the backup data whenever I need. My question is if phpMyAdmin can make backup and resotore it secure and completely without any data lose?
(I have both MyISAM and innoDB in my database structore)
Also, if you know any other IDE to make backup and restore it without showing the database structures and tables to the end-user, please tell me their names.
Thank you.
If you're running MySQL on your own server you may copy the database folder, but the MySQL server would have to be stopped first. Anyway I'd recommend dumping the databases through phpMyAdmin (export function) or via the command line (mysqldump). Using the latter, you may write a batch script that also compresses and encrypts the content of the dump file.
Using the built in Import and Export? The only data loss would be everything after the backup until the time the backup was imported.
Securely? That's an entirely different topic. There's too many things to consider to call anything secure but if you're using https or on a trusted LAN, then yes, I guess it's secure.
I think MySQL Workbench can do exports and imports.
If would you wish to backup MySQL database more securely and periodically without loss of data to remote server or local drive (local hard disk or mapped drive), then you can try Vembu StoreGrid http://www.vembu.com/, a leading backup software trusted by more than 2700 service providers world wide. Once you configured single backup by selecting entire database then automatically newly added database will be backedup on upon next backup time. Also, StoreGrid backups only the incremental bytes of changes on next incremental schedule.
Vembu has a solution for almost everyone, just check them below:
For Service Providers : StoreGrid Service Provider Edition
For Business/Offices : StoreGrid Professional Edition
For Home Users: Vembu Home
For Resellers who don't want to have their own storage : Vembu Pro
For Hosting Providers: StoreGrid Hosting Provider Edition (yet to be released)
For your requirement, we would suggest the Professional Edition http://storegrid.vembu.com/online-backup/network-backup.php of StoreGrid. Try it!!!
Regards,
Thileepan
vembu.com

creating softlink to databases in mysql

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.