I want to store a string in Mysql database whose length is 1000000 (1 Million characters). Which datatype should I use? Which is best method for this ?
            Asked
            
        
        
            Active
            
        
            Viewed 4,634 times
        
    -1
            
            
        - 
                    Either use a different type of db such as mongo or store it on harddisk – Mihai Jan 15 '15 at 17:56
- 
                    Look for datatype 'text' – Jens Jan 15 '15 at 17:56
- 
                    http://stackoverflow.com/questions/15406299/mysql-best-way-to-store-long-strings – user2879041 Jan 15 '15 at 17:56
- 
                    here is a helpful resource for your question [**LINK**](http://stackoverflow.com/questions/2023481/mysql-large-varchar-vs-text) also just so you know, you are most likely getting the downvotes because you didn't seem to do any research, a simple google search ("mysql store long text") shows that the first two results are the answers you want. – John Ruddell Jan 15 '15 at 18:00
1 Answers
3
            
            
        You'll need to use one of the BLOB types. Pick one that suits your needs.
For 1MB of data you'll probably go with LONGTEXT.
 
    
    
        tadman
        
- 208,517
- 23
- 234
- 262
 
    