Comments - MariaDb vs Oracle
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
1) Yes. I think there's also some overhead like two bytes per column, which in your case would mean a VARCHAR would have a max of 64,531.
2) Don't know, but I'd be wary of using CONNECT (which I believe is beta software) to update another vendor's tables. I see CONNECT as a read-only solution at present.
3) I'm not sure what you mean here. If you mean the files containing the data in "datadir", you can move MyISAM files when mysql is not running, but you SHOULD NOT EVER move InnoDB files, because even with "innodb_file_per_table = 1" (the default), there is still necessary metadata in file "ibdata1" that will keep the moved file from working properly. (Voice of experience.)-:
If you mean moving tables between databases, with the exception of MyISAM tables (which can be moved in the filesystem), I think you are best using mysqldump, edit the file to change the name of the database, make sure the database exists, then USE it to import. Something like this will work in the shell:
<pre># mysqldump MyOldDatabase MyTableToMove;
By the 3rd question I mean to move a simple text file(not a database file) from a directory to another one ,how to do a file copy +remove operations using MariaDb?
I think MariaDB is inappropriate for moving ordinary files.
Why can't you simply use the filesystem? Like the Linux/UNIX "mv" command? (Or equivalent Windows command?)
The mysql client program includes the SYSTEM command, which you can use to execute file system commands. So in a .sql script file, you could have "SYSTEM mv oldname newname;"
I need to move the file usinga MariaDb routine or procedure : I have to read a text file and split it into many files (each file will be processed by a specific routine) ,Once I finish spliting it, I have to copy the text file in another directory and delete the existing one. How can I accomplish this ?
As far as I know, there are no general-purpose file-manipulation commands in MariaDB/MySQL. Which is good, from a security point-of-view.
You'll have to write a user-defined function. Which is bad, from a security point-of-view: http://dev.mysql.com/doc/refman/5.7/en/adding-functions.html
There are (scary) UDFs available that will let you fire off a shell script. But they will run with the permission of the user running mysqld, and could be invoked by any SQL user. This means (for example) that someone with only SELECT permission could run a script that does "rm -rf /usr/local/var/mysql/*"
Here is enough rope to hang yourself: https://patternbuffer.wordpress.com/2012/09/14/triggering-shell-script-from-mysql/
You might consider a totally different approach: using a shell script that does the file manipulation you require while running mysql with the data manipulation you require.
You cannot run file manipulation from MySQL, but you <i>can</i> run MySQL from a file manipulation program. That seems the path of least resistance, rather than trying to use a hammer to drive screws.
Thanks a lot for your feedbacks.Another questions please:
-Oracle has the tablespace feature ,does MariaDb has the same feature ? -If yes how MariaDb encrypt a given tablespace ?