LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-14-2016, 02:43 AM   #1
cyberdome
Member
 
Registered: Mar 2014
Distribution: Fedora 23 - MariaDB 10.1 -
Posts: 130
Blog Entries: 2

Rep: Reputation: 8
how to create fake DATA inside MariaDB SQL database???


Hello World,

I am trying to create some TEST DATA, meaning fake date for playing around with MariaDB tables and databases.

I need to create some fake random data using SQL RDBMS. So, why not use Mockaroo.com , but on that website I can only do 1000 rows at one time. Which is extremely time consuming.

How can I create random fake data. Tons of it. For example, Let us say I want 2 millions rows of random data with ID, NAME, ADDRESS, PHONE, EMAIL.

I hope I am making sense. Any help is greatly appreciated!!!!!

Thanks
 
Old 05-14-2016, 07:36 AM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,668
Blog Entries: 10

Rep: Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077
Quote:
Originally Posted by cyberdome View Post
How can I create random fake data. Tons of it.
You don't. Well, you can, but it' not necessary that you do.
Mockaroo.com is certainly "cute" but wholely inadequate for your task, IMO.

Google "mysql sample databases download" without the quotes and have at it.

Do you have any experience with mysql?

Or is this a mongo-specific task?
 
Old 05-14-2016, 11:16 AM   #3
cyberdome
Member
 
Registered: Mar 2014
Distribution: Fedora 23 - MariaDB 10.1 -
Posts: 130
Blog Entries: 2

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by Habitual View Post
You don't. Well, you can, but it' not necessary that you do.
Mockaroo.com is certainly "cute" but wholely inadequate for your task, IMO.

Google "mysql sample databases download" without the quotes and have at it.

Do you have any experience with mysql?

Or is this a mongo-specific task?
No, I don't have whole a lot of experience with MariaDB or MySQL. I wanted to figure out If I could somehow write a SQL query that would create huge amounts of fake data.

No, It is not a mongo-specific task. I am currently reading the MariaDB docs and the MySQL docs.

Thanks
 
Old 05-14-2016, 11:21 AM   #4
cyberdome
Member
 
Registered: Mar 2014
Distribution: Fedora 23 - MariaDB 10.1 -
Posts: 130
Blog Entries: 2

Original Poster
Rep: Reputation: 8
Found something while looking around the internet.

INSERT INTO yourtable
SELECT seq,CONCAT('NAME FROM:',seq), CONCAT('ADR:',seq), CAST(RAND(SEQ)*10000000 AS INT),CONCAT(seq,'@dumymail.xx') FROM seq_1_to_1000000;
 
Old 05-14-2016, 12:39 PM   #5
cyberdome
Member
 
Registered: Mar 2014
Distribution: Fedora 23 - MariaDB 10.1 -
Posts: 130
Blog Entries: 2

Original Poster
Rep: Reputation: 8
Found a tool that might help.

https://sourceforge.net/projects/spawner/
 
Old 05-16-2016, 09:00 AM   #6
JockVSJock
Senior Member
 
Registered: Jan 2004
Location: SATX
Distribution: RHEL/CentOS
Posts: 1,198
Blog Entries: 4

Rep: Reputation: 131Reputation: 131
If this solution works, please mark this thread as "Solved."

thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Create database and import data into it, mysql szboardstretcher Programming 3 09-07-2012 01:06 PM
[SOLVED] LAMP question. How to create new database from PHP, SQL zubat123 Linux - Server 2 11-05-2010 02:38 AM
My SQL 1045 error : couldn't create database lin_myworld Linux - Server 1 12-23-2007 10:18 AM
Data from web form to SQL database crazydark Programming 5 03-14-2007 02:37 AM
How to create a SQL Database in Linux? Phonics3k Programming 4 08-16-2003 04:31 AM


All times are GMT -5. The time now is 06:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration