Skip to Main Content
  • Questions
  • Martian wants to import XML table from Access

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Steve.

Asked: March 06, 2017 - 9:04 pm UTC

Last updated: March 07, 2017 - 11:48 pm UTC

Version: MySQL server 5.6 Workbench 6.3

Viewed 1000+ times

You Asked

I am so very lost.

Thinking I might finally try to figure out how to use MySQL as a replacement for Access2007; I think I downloaded everything I needed, including VB support for C++. I'm pretty sure, but not certain.

But for the sake of this likely very absurd question, suppose I am an intelligent being from another planet. Fairly intelligent, just completely ignorant about MySQL. And suppose I've downloaded everything I was supposed to. Now What?

I am in Windows 8.1
I go to RUN, look for All Programs, find MySQL folder, click on it.
This takes me to a selection of 5 alternatives, and I chose MySQL Server 5.6 (not sure why I pick this, but I do)
I choose MySQL Server 5.6 Command Line Client (shows twice, and no other alternatives?)

I am taken to what appears to be an old-school DOS command line black box, and it just says "Enter Password: " with no quotation marks.

Passwords - who knows? A few years ago I tried the same thing and became overwhelmed and gave up. At that time I created (and most importantly recorded) various passwords as I created them for this product. I key in the rather lengthy password, it thinks, then shows an ERROR before blinking out of sight.

I don't have the slightest clue how to get past the Password screen; as I've tried every single word/phrase that resembles a password in my password rolodex.

Suppose I am from the constellation of Orion.
Please tell me exactly how to:
#1 - Eliminate all MySQL files and start over, using Add/Remove Programs in Windows (which I know how to do already). If I need to. How do I know if I should even do this step?
#2 - Make certain I have the correct MySQL version for just one person. (I just want to experiment with import/export with MS Access) Should I download/use Installer, Connector, Workbench, Notifier, for Visual Studio?? I don't have any idea, I'm from Orion, how could I know? I think I might try Visual Studio as a web page design tool; and it is desired that I could use Visual Studio and MySQL together to form a great catalog website - but clearly that is WAY in the future.
#3- How do I start the program? I see no typical Windows icon to click.
#3a - If I have to use the RUN Program via Windows, what program do I select and where should it likely be if it installed into the "default" location?
#4 - How do I create and save an empty MySQL database?
#5 - Once I've saved the empty database and closed it, how do I retrieve it for next time? (Icon? Pathname? If a Pathname, any idea what that might be?

NEVERMIND those fun and games from earlier today..........

I will never be able to accomplish my experimentations without being able to even see the product, let alone open it up and test it's very basic import/export table features.

I've tried to inject a little humor into my note to hide the extreme frustration my ignorance is causing me.

In a flash of inspiration, I checked my "downloads" folder and located:
MySQL-Workbench-Community 6.3.9; with about 29MB of stuff; I clicked and it seems to install MySQL Workbench 6.3 CE; once complete I "Launch Now" to see what happens next!

Well now I have a virgin database. Next, I want to extract info from my Access database. I entered the Access database and did an ODBC export to file.

However, I cannot retrieve/use this file -not yet anyway; and the help here: https://dev.mysql.com/doc/workbench/en/wb-admin-export-import.html makes me .....unpleasant. I am this way because I see no menu linkages that will take me to these menu options. I look further for help here; https://dev.mysql.com/doc/workbench/en/wb-develop-sql-editor-table-export-import.html which refers me back to where I just was - a circular dance of no more help.

I have my new "model" open, I have a table I've named "world" and another virgin table under a different "schema" named "blanker" with the idea of importing my Access table into the shell currently known as "blanker".

I don't know how to enable wizards, or if this is even possible. Regardless, I am beginning to fondly recall why I junked this in the first place a few years ago, as my experience today has been less than great.

Life shouldn't be so hard.

After 5 hours, I have 2 empty tables staring me in the face, with no apparent way to populate them with data I've exported to files from Access. AND the help I've found on Oracles website is not helpful and moreover a circular dance of hopelessness.

Now, the only thing I want to know how to do is get data that has come from one table in an Access 2000/2007 database into a table in a MySQL database that is completely non-formatted.

Can you tell me the keystrokes to accomplish this seemingly infantile task?

Plain English that an intelligent but woefully ignorant alien from another planet could understand would be fantasic. Pretty please?

and Connor said...

OK, I'm a total mysql newbie myself, so I thought I'd share my experiences with you.

(btw, if it was me, I'd be using Oracle XE...but thats another discussion)

So I installed mysql, and then did this:

mysql> CREATE TABLE demo (empno INT);
ERROR 1046 (3D000): No database selected


so I need a database

mysql> create database asktom;
Query OK, 1 row affected (0.01 sec)
mysql> use asktom;
Database changed


Now I create my table and add some columns

mysql> CREATE TABLE demo (empno INT);
Query OK, 0 rows affected (0.06 sec)

mysql> ALTER TABLE demo ADD COLUMN ename VARCHAR(40);
Query OK, 0 rows affected (0.11 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> ALTER TABLE demo ADD COLUMN salary int;
Query OK, 0 rows affected (0.10 sec)
Records: 0  Duplicates: 0  Warnings: 0


Now I got some CSV data that I had on my PC

7369,"SMITH",800
7499,"ALLEN",1600
7521,"WARD",1250
7566,"JONES",2975
7654,"MARTIN",1250
7698,"BLAKE",2850
7782,"CLARK",2450
7788,"SCOTT",3000
7839,"KING",5000
7844,"TURNER",1500
7876,"ADAMS",1100
7900,"JAMES",950
7902,"FORD",3000
7934,"MILLER",1300

and tried to load it

mysql> LOAD DATA INFILE "c:\temp\data.csv"
    -> INTO TABLE demo
    -> COLUMNS TERMINATED BY ','
    -> OPTIONALLY ENCLOSED BY '"'
    -> LINES TERMINATED BY '\n';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement


Nope, didnt like that, which makes sense - it doesnt want me loading data from insecure locations. So a bit of googling and I find the "LOCAL" keyword

mysql> LOAD DATA LOCAL INFILE "C:\temp\data.csv"
    -> INTO TABLE demo
    -> COLUMNS TERMINATED BY ','
    -> OPTIONALLY ENCLOSED BY '"'
    -> LINES TERMINATED BY '\n';
ERROR 2 (HY000): File 'C:       empdata.csv' not found (Errcode: 2 - No such file or directory)


Hmmmm...looks like backslash is an issue, so I escape that


mysql> LOAD DATA LOCAL INFILE "C:\\temp\\data.csv"
    -> INTO TABLE demo
    -> COLUMNS TERMINATED BY ','
    -> OPTIONALLY ENCLOSED BY '"'
    -> LINES TERMINATED BY '\n';
Query OK, 14 rows affected (0.01 sec)
Records: 14  Deleted: 0  Skipped: 0  Warnings: 0

mysql> select * from demo;
+-------+--------+--------+
| empno | ename  | salary |
+-------+--------+--------+
|  7369 | SMITH  |    800 |
|  7499 | ALLEN  |   1600 |
|  7521 | WARD   |   1250 |
|  7566 | JONES  |   2975 |
|  7654 | MARTIN |   1250 |
|  7698 | BLAKE  |   2850 |
|  7782 | CLARK  |   2450 |
|  7788 | SCOTT  |   3000 |
|  7839 | KING   |   5000 |
|  7844 | TURNER |   1500 |
|  7876 | ADAMS  |   1100 |
|  7900 | JAMES  |    950 |
|  7902 | FORD   |   3000 |
|  7934 | MILLER |   1300 |
+-------+--------+--------+
14 rows in set (0.00 sec)


and there you go :-)

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

DOS prompt vs GUI in Workbench

Steve Freeman, March 07, 2017 - 8:00 pm UTC

Hi. I think if I were coming in at a DOS-like prompt, I could follow. However, I am coming in via a GUI with Workbench. As such, I am trying to determine how to get MySQL to accept an ODBC export I'm making via Access 2007.
Very frustrating, especially for a hobbyist like myself.
I have no problem creating the output from Access, it's just getting it into MySQL that is giving me fits. Headaches I don't need, to be truthful.
I know there must be an elegant way to accomplish this.
MySQL Workbench is on my computer, as is the Access database; so there is no network to fiddle with - it's all on one machine.
Regardless, thanks for looking at my problem.
FWIW, I am working with a real estate property database. My data can be captured in about 5 Access tables, 4 of which are very small. The 5th table contains info on houses; would hold about 600 records with 200 fields per record. After I compact/repair Access, the 600 records "squish" down into about 5.5MB so the database is not huge.
It just feels like I am jamming a square peg into a round hole.
To top it off, my virus protection identified a possible Trojan Horse in the Workbench.
IOBit Malware Fighter 4.5 Pro found a trojan?

C:\Program Files\MySQL\MySQL Workbench 6.3 CE\ogr2ogr.exe
trojan.generic

just dandy. The fun just never ends!
Connor McDonald
March 07, 2017 - 11:48 pm UTC

Wouldnt the commands I used transfer directly over to the "SQL Development" section on the GUI ?