Can I store data files (e.g. txt files) to the MySql server? If I can, how to store them?
Sure you can. I would suggest reading the data from your files and then saving it in your database, i would say in a text field.
You can use something like this to get the file's content:
$file = file_get_contents('./yourfile.txt');
Then insert it
Insert into myTable VALUES (mytextfile = $file)
Yes you can, but you would probably be better off storing them on the file system and storing a path to the file in the DB.
There are a few SO Posts that discuss this:
You can use LOAD DATA INFILE to read the contents of a file and store it in a table in the database in a structured format.
This can be considerably faster than reading and parsing the file on the client and then using multiple INSERT statements.
Example:
LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;
How much text are we talking about here? If there's not that much text, you can store just the content of the file in the database.
You can also store the file itself as a BLOB. http://dev.mysql.com/doc/refman/5.5/en/blob.html
If you'll be dealing with many files, you'll probably be better off storing the files on your sever with the file path in the database.