Viewing blob data-type in mysql - mysql

I have downloaded a mysql table in text format from one our collaborator's. I have dumped the table into a table on mysql database on my machine successfully. The table was created using their sql file. SO they have some of the fields with blob data-type, and I am unable to view them in mysql. when I opened the same downloaded text file with csv I could see the fields with blob data-type with letters like BC,ABD,BDS. I do not understand why I am unable to view the fields in mysql. Anyone have ideas?

This is sure you can not see the blob data directly when you view the table data from mysql. But i think when you click the edit link of particular row you might see the data but i'm not sure about this. If you are using any server script then you definitely gonna see data without any hassle using simple select query. Like
SELECT COLUMN_NAME FROM TABLE_NAME
// REGARDLESS OF COLUMN_NAME DATA TYPE

Related

How to export from mysql database to database document table definition book

My problem is that I am getting a mysql database with lots of tables. And the need to output the same document as the file I attach, Is there any tool that supports this?
Thanks so much.
The information you want is in the INFORMATION_SCHEMA.COLUMNS table, or the output of SHOW COLUMNS.
there is a tool to select the column from each table you want to extract on excel.
check Microsoft tutorial
you should obtain this menu :
enter image description here
and you just drop the column you want

MYSQL csv filename to table

Is it possible to search a folder and grab a file name to convert into a mysql table? Can it be done in a query or stored procedures?
I'm new to mysql and so far I can read my data and create a table which is manually done, but don't know how to create a table with its file name automatically.
LOAD DATA
LOCAL INFILE 'D:/test.csv'
INTO TABLE test
Unfortunately it's not possible for LOAD DATA to create the table for you. The syntax for the function goes as ...
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
[REPLACE | IGNORE]
**INTO TABLE tbl_name**
The table name has to be specified, which means you have to create the table first.
Why is it so?
There are so many different data types that are supported in a mysql table that the importer is unable to judge for itself which data type to use.
Fro example if the first line in the CSV was
hello, 1
The importer might choose CHAR(5) and INT but the next line might be
Colombo, Galle
This line cannot be imported into CHAR(5) or INT
You have tagged your question with mysql-workbench, even though you don't ask about this tool. But let me tell that MySQL Workbench indeed can be of help here. In the SQL IDE which opens when you click on a connection tile on the homescreen you can use the context menu in the sidebar to open the table data import wizard. This will help you to import CSV (or JSON) data from a file and will also create the target table for you (if you don't pick an existing one).

How to Encrypt the whole structure of a table in phpmyadmin?

I am facing problem regarding the encryption of the structure of a table in phpmyadmin. like i want to see the structure of a table in encrypted form when i export a table from phpmyadmin. means i want that the fields of the table appear in .sql file should be encrpted so that no one can read the information about fields of the table. i have search a lot on google, yahoo but i don't find any solution to do this. Please it will be a great favour. Thanks in advance
the example is here
basically i have a table name student with fields like name, cnic, dob i want that when i export the whole table into sql file from phpmyadmin the fields name like name, cnic, dob should be appear encrypted. so the user don't able to read them. just i want to do this task
I believe you can encrypt table data while you are saving in MYSQL, so that MySQL doesn't even know it's encrypted.
Result: Whenever you export table data either from phpmyadmin, No one can read that sql or csv file without decypting it.
If you are showing data you can de-crypt it back for getting its actual form.
Note: If you encrypt your data with any method like MD5 you can't
get its actual form (De-crypt from).

Export mysql to ASCII in phpMyAdmin

I would like to save database schema using describe function to visualise the tables for others in a team, in mysql terminal you can use describe tablename which would output in a table all in text which I would simply pipe to a text file.
In this current environment I do not have access to mysql terminal but only through phpMyAdmin, is there a way I can get a table view using text in phpMyAdmin? I know phpMyAdmin has its own print view but this is not what I want, I want just plain text.
The nice "table as text" rendering that the mysql console is doing is unique to that software.
It is basically how mysql console renders any result set that you get from your query.
PhpMyAdmin will render all the results sets in a HTML table. As far as I know they do not emulate the text output because they have no reason to.
If you are able to run a PHP script on that machine you could use that to render the result set as text and display it in a webpage.
Phpmyadmin has an export function.
If you export only the structure of your database, but not the data, and you export it to SQL format, you will get a text file with your database's DDL nicely formatted.
That should help you document the database for your team.

Can I import tab-separated files into MySQL without creating database tables first?

As the title says: I've got a bunch of tab-separated text files containing data.
I know that if I use 'CREATE TABLE' statements to set up all the tables manually, I can then import them into the waiting tables, using 'load data' or 'mysqlimport'.
But is there any way in MySQL to create tables automatically based on the tab files? Seems like there ought to be. (I know that MySQL might have to guess the data type of each column, but you could specify that in the first row of the tab files.)
No, there isn't. You need to CREATE a TABLE first in any case.
Automatically creating tables and guessing field types is not part of the DBMS's job. That is a task best left to an external tool or application (That then creates the necessary CREATE statements).
If your willing to type the data types in the first row, why not type a proper CREATE TABLE statement.
Then you can export the excel data as a txt file and use
LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table;