MySQL database.

  • Thread starter John Fitzsimons
  • Start date
J

John Fitzsimons

MySQL is freeware. I wanted to create a MySQL database. After going
to the site http://www.mysql.com/ it wasn't at all clear how I could
do that short of learning a great many command line instructions. Even
downloading the 24MB file and attempting to read the help file didn't
help.

Can anyone suggest a program/URL that could help me convert a
c.s.v., spreadsheet or Access database into a MySQL database
please ?


Regards, John.
 
P

P

John said:
MySQL is freeware. I wanted to create a MySQL database. After going
to the site http://www.mysql.com/ it wasn't at all clear how I could
do that short of learning a great many command line instructions. Even
downloading the 24MB file and attempting to read the help file didn't
help.

Can anyone suggest a program/URL that could help me convert a
c.s.v., spreadsheet or Access database into a MySQL database
please ?

This isn't specific help, but if you grab Xampp -
http://www.apachefriends.org/index-en.html - that can be installed
incredibly easily (get the Installer version) and gives you mysql and
phpmyadmin (along with some others) which may make the process easier ?
 
T

Thorsten Duhn

Hello,
MySQL is freeware. I wanted to create a MySQL database. After going
to the site http://www.mysql.com/ it wasn't at all clear how I could
do that short of learning a great many command line instructions. Even
downloading the 24MB file and attempting to read the help file didn't
help.

Can anyone suggest a program/URL that could help me convert a
c.s.v., spreadsheet or Access database into a MySQL database
please ?

don't know about conversion, but working with MySQL (creating,
editing...) "MySQL Control Center" from the same site than MySQL
is really great for!

Although, what do you want to use it for, when you don't wanna
learn SQL statements?

Regards,
Thorsten
 
M

Mark Carter

Although, what do you want to use it for, when you don't wanna
learn SQL statements?

Yes, Microsoft Access it aint; but then again, that goes for all other
non-Access databases, too. It's command lines all the way.

The first thing you'll want to do after setting up MySQL, it's
privileges and whatnot, is CREATE DATABASE:
http://dev.mysql.com/doc/mysql/en/CREATE_DATABASE.html

Then you'll need to CREATE TABLE:
http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html
You'll need to figure out a "schema" for the table (which is the column
ordering, and what types they are and what they should be called)

Then you'll probably want to LOAD DATA from the csv file to the table:
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html

Have fun!

A slightly less powerful, but easier-to-handle database is called SQLite:
http://www.sqlite.org/

It has the advantage of being able to store databases in a single file,
and doesn't require as much administrative setup. It even comes with TCL
bindings for creating GUIs; but don't expect it to be as straightforward
as for MS Access.
 
C

Cousin Stanley

....

A slightly less powerful, but easier-to-handle database is called SQLite:
http://www.sqlite.org/

It has the advantage of being able to store databases in a single file,
and doesn't require as much administrative setup.

It even comes with TCL bindings for creating GUIs;
but don't expect it to be as straightforward as for MS Access.

Mark ....

It might also be noteworthy that SQLite
has the pysqlite bindings for Python ....

Python interface to SQLite, pysqlite is an interface
to the SQLite database server for Python.

It aims to be fully compliant with Python database
API version 2.0 while also exploiting the unique features
of SQLite.

I use pysqlite under both Win98_SE and Linux/Debian ....
 
J

John Fitzsimons

John Fitzsimons wrote:
This isn't specific help, but if you grab Xampp -
http://www.apachefriends.org/index-en.html - that can be installed
incredibly easily (get the Installer version) and gives you mysql and
phpmyadmin (along with some others) which may make the process easier ?

Thanks. I will check it out. It looks like I might have to download
again another 20, 30 or 40MB of files. Hope they contain something
that makes sense. In windows converting from one format to another
only takes a matter of minutes with most programs.

Regards, John.
 
J

John Fitzsimons

Thorsten Duhn wrote:
Yes, Microsoft Access it aint; but then again, that goes for all other
non-Access databases, too. It's command lines all the way.
The first thing you'll want to do after setting up MySQL, it's
privileges and whatnot, is CREATE DATABASE:
http://dev.mysql.com/doc/mysql/en/CREATE_DATABASE.html

My web host has a method for creating a database with nothing in it. A
start perhaps but what use is a database without data ?
Then you'll need to CREATE TABLE:
http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html
You'll need to figure out a "schema" for the table (which is the column
ordering, and what types they are and what they should be called)

Thanks, that's a bit more help. But how many windows users would know
what things like

| TINYBLOB
| BLOB
| MEDIUMBLOB

etc. mean ?
Then you'll probably want to LOAD DATA from the csv file to the table:
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html

Okay. Thanks. If I ever reach step two then this step three should be
handy.
Have fun!
A slightly less powerful, but easier-to-handle database is called SQLite:
http://www.sqlite.org/

Thanks. That looks slightly friendlier but again it means I need to
learn a whole programming language before I can use it.
It has the advantage of being able to store databases in a single file,
and doesn't require as much administrative setup. It even comes with TCL
bindings for creating GUIs; but don't expect it to be as straightforward
as for MS Access.

Yes, I know UNIX isn't as simple as windows BUT a simple "cut and
paste" example would be nice. How many MySQL databases are there on
the web for eg. book searches ? A lot.

How many "cut and paste" examples are there for people to learn from ?
It appears to be NIL from where I am standing. :-(

Regards, John.
 
J

John Fitzsimons

don't know about conversion, but working with MySQL (creating,
editing...) "MySQL Control Center" from the same site than MySQL
is really great for!

Well, I am pretty sure I had that open. It has a tabbed interface
doesn't it ? It made no sense to me. The MySQL people don't appear to
have heard of "wizards", "templates", "step by step" instructions etc.
Or at least I couldn't find anything that said "To create a database
you...

(1).....

(2).....

etc.
Although, what do you want to use it for, when you don't wanna
learn SQL statements?

I have a host that will upload data from a MySQL database. My database
however is a c.s.v. file.

Once uploaded my next step would be to sort/search the database. That
looks at this stage to be just as complicated. :-(

Regards, John.
 
J

JanC

Mark Carter schreef:
Yes, Microsoft Access it aint; but then again, that goes for all other
non-Access databases, too. It's command lines all the way.

MS Access is just a GUI/RAD to work with databases.
The default database used by Access is MS Jet (that's the one that creates
..mdb files), but you can use Access to access a MySQL database too, if you
want...
 
S

Susan Bugher

John said:
Yes, I know UNIX isn't as simple as windows BUT a simple "cut and
paste" example would be nice. How many MySQL databases are there on
the web for eg. book searches ? A lot.

The majority of online databases are done by professionals. Booksellers
upload to the databases (the ABE, Alibris, Amazon etc. etc. etc. sites)
from the databases on their computers.
How many "cut and paste" examples are there for people to learn from ?
It appears to be NIL from where I am standing. :-(

If you want a web site of your own *and* simplicity I believe Chrislands
is one of the best options. Note: I have only second-hand knowledge of
the Chrislands site and no financial interest.

www.chrislands.com/shops/faq.php

This may be of interest:

Q5: Can I upload my books from my current book database program?
A: Absolutely. Integration with your current book database program is a
feature that distinguishes us from other online store services. Updating
your own online bookstore is done in the same manner as you update your
listings on the book selling services like www.abe.com. You can
upload/update your inventory by FTP or browser upload. Chrislands
supports uploading from the following programs.

* Homebase
* Bookmate
* BookHound
* BookRouter.com - Highly Recommend
* BookTrakker
* Readerware
* Any program that can export in UIEE format
* Any program that can export in our tab-delimited format
* Any program that can export in our comma-delimited format

Note: IIRC pages at Chrislands are searched by Google. Google *doesn't*
search online databases. The database services are starting to address
that issue/problem - some are further along with this than others.

Susan
 
M

Mark Carter

The first thing you'll want to do after setting up MySQL, it's
My web host has a method for creating a database with nothing in it. A
start perhaps but what use is a database without data ?

Well, you might as well ask what the point of creating an Access
database is if it doesn't come with your data already in it. The answer
is that you have to create an empty database first (CREATE DATABASE),
set up the table structures (CREATE TABLE), and then populate the
database with data (LOAD DATA). These are three distinct, logical stages.

So, your first step is to think of the name of a database. Let's call it
JohnsDb for the sake of argument. The command you'll want to issue is:
CREATE DATABASE JohnsDb

Now, look at your CSV file. It will have columns. Think of a name for
those columns, and a type. I don't know what the structure of your CSV
file, so let me take the example of the CSV file being information about
friends. Suppose the CSV file contains columns for firstname, surname,
and height. Well, their names will be strings, and their height will be
floats. Strings are declared using VARCHAR. You have to decide how many
characters you'll allow for the names. Let's say 20 characters apiece.

So, to create the table, you'll need to issue a command like:

CREATE TABLE friends (firstname VARCHAR(20), surname VARCHAR(20), height
FLOAT)

SQL syntax can vary a bit from db app to db app, so someone should
correct me if I'm wrong. There may need to be a PRIMARY KEY inserted in
the above statement.

My own webpage contains some trimmed-down examples of commands that can
be issued:
http://www.markcarter.me.uk/computing/sql/sql.html

Again, they're not necessarily valid for all db apps, but they should at
least point you in the right direction without you having to decipher
BNF (Bachus Naur Form) (a way of specifying language grammars).
 
R

REM

I have a host that will upload data from a MySQL database. My database
however is a c.s.v. file.

This looks to be the easiest route to load your data file:

http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html


Copy your .csv file to "john.txt." Run a search\replace and replace
commas with tab characters.


LOAD DATA INFILE 'john.txt'
INTO TABLE Book
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
Once uploaded my next step would be to sort/search the database. That
looks at this stage to be just as complicated. :-(

You'll have to create the DB and table(s) beforehand. You tell MySQL
what data you intend to store into what table(s) and the primary and
foreign keys that are used to create a relational DB (if required).

You can write all of this into a text file beforehand, upload it, and
execute it.

I'm playing with SQLPlus and all commands can be written into a .sql
file, say Book.sql, which is executed by typing "get Book.sql."

----------------- Book.sql -----------------------------------

set echo on
create table Book
(ISBN varchar(15),
Author varchar(35),
SSN char(9),
Title varchar(40),
Pages number(4)
Price number(3,2)
Primary Key (ISBN));

----------------- Book.sql -----------------------------------

ISBN is a variable character field up to 15 characters.
Author is a variable character field up to 35 characters.
SSN is a nine character field.

Pages is a number field holding up to 4 digits.
Price is a decimal value with up to 3 digits left and 2 right of the
decimal.

The primary key is ISBN, which must be a unique value.

Then you could load your data file as described above.

The commands to sort or search are fairly easy after you make it to
the point you have created and populated a table.

http://dev.mysql.com/doc/mysql/en/CREATE_DATABASE.html

http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html

There are constraints and buffers and all sorts of other complications
that might require attention at some point.

I'd have to suggest Open Office, the Excel clone portion, to accept
your .csv file and allow sorting and searching.
 
J

Joel

John said:
MySQL is freeware. I wanted to create a MySQL database. After going
to the site http://www.mysql.com/ it wasn't at all clear how I could
do that short of learning a great many command line instructions. Even
downloading the 24MB file and attempting to read the help file didn't
help.

Can anyone suggest a program/URL that could help me convert a
c.s.v., spreadsheet or Access database into a MySQL database
please ?


Regards, John.

You could try Rekall (www.rekallrevealed.org - reviewed in Oct 2004 PC
User Mag). Freeware. Supposedly a "reasonably user-friendly front end"
for MySQL, PostgreSQL and Firebird. GUI-based. Haven't used it myself
but it certainly looks like it could become the Access of the Linux world.

Joel
 
J

John Fitzsimons

John Fitzsimons wrote:
The majority of online databases are done by professionals. Booksellers
upload to the databases (the ABE, Alibris, Amazon etc. etc. etc. sites)
from the databases on their computers.

Fine, but it would be nice if at least one of them offered a "cut and
paste" and/or "step by step" for other people.
If you want a web site of your own *and* simplicity I believe Chrislands
is one of the best options. Note: I have only second-hand knowledge of
the Chrislands site and no financial interest.

< snip >

Thanks. But paying a Set Up Fee of $199.99 and $9.99 a month for
the service does not appeal to me. I can see however that it might
interest others with a better financial situation than myself.

Regards, John.
 
J

John Fitzsimons

Well, 86 all of that. This might be a tool you can use if you want to
play with MySQL:

"MySQL Control Center (also known as MySQLCC) is a
platform-independent GUI administration client for the MySQL database
server."

Thanks, but I cannot find an active download link for that. I have
however come across another program that might do the job.

Regards, John.
 
J

John Fitzsimons

John Fitzsimons wrote:

Hi Joel,
You could try Rekall (www.rekallrevealed.org - reviewed in Oct 2004 PC
User Mag). Freeware. Supposedly a "reasonably user-friendly front end"
for MySQL, PostgreSQL and Firebird. GUI-based. Haven't used it myself
but it certainly looks like it could become the Access of the Linux world.

It looks very good. The screenshot links appear dead though. So did
the links to the download info. It looks to me that it isn't a windows
program. :-(

Regards, John.
 
R

rj65

John Fitzsimons said the following on 10/7/2004 4:44 AM:
MySQL is freeware. I wanted to create a MySQL database. After going
to the site http://www.mysql.com/ it wasn't at all clear how I could
do that short of learning a great many command line instructions. Even
downloading the 24MB file and attempting to read the help file didn't
help.

Can anyone suggest a program/URL that could help me convert a
c.s.v., spreadsheet or Access database into a MySQL database
please ?

I use a very friendly front-end to MySQL called MySQL-Front, which
unfortunately has now become shareware. It does have a few import
options, and I'm sure CSV import should be possible.

The last freeware version was 2.5. I googled for it, but couldn't find
any working download links. I have it; if there's any interest, I could
upload it to YouSendIt. Let me know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top