[Solved] Primary Key not Saved

Creating tables and queries
Post Reply
rhammer54
Posts: 12
Joined: Sat Jan 04, 2020 1:52 pm

[Solved] Primary Key not Saved

Post by rhammer54 »

I am trying to move my databases which are currently mysql type to oo base. I have created csv versions of the populated tables using the export feature of phpmyadmin. Then I have opened the csv files in oo calc and added an addtional row at the top of the sheet for the table's field names. I have then copied and pasted the table into my new oo base table pane. However I am unable to set the primary key which is one of the fields transferred from the mysql table. The field I am trying to set as the primary key is an Integer.
Another post on this forum suggests it may be because my table is a spreadsheet. If this is the case then how do i change the tables format.
I am totally new to oo base and also have no experience of ms access - only ever having used mysql/php to create databases from being an ex web designer.
thanks in advance Bob
Last edited by rhammer54 on Sun Jan 05, 2020 3:09 pm, edited 1 time in total.
OpenOffice 4.1.5 on Windows 10
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Primary Key not Saved

Post by UnklDonald418 »

The first screen when you open Base has an option Connect to an existing database, Mysql is one of the options.
Once Base is connected to your Mysql database, open a second Base window (it will display Embedded database HSQL database engine along the bottom of the window).
You can drag and drop (or copy and paste) to copy the Mysql tables one by one into the Embedded Base database. Each time you will see a Copy Table dialog that allows numerous options including the ability to pick which fields are copied and in what order, edit field names and adjust formatting. You can also designate a Primary Key on the Type formatting page of the dialog by right clicking on a field in the list of names in the left pane of the dialog page.
Since you are new to Base it might be better to let Base generate a Primary Key for you. There is an option for that on the first page of the dialog.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Primary Key not Saved

Post by Villeroy »

Why don't you use Base with MySQL? Embedded HSQL is not an option for any productive database.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
rhammer54
Posts: 12
Joined: Sat Jan 04, 2020 1:52 pm

Re: Primary Key not Saved

Post by rhammer54 »

Replying to both the previous posts. Yes I would prefer to connect to my existing mysql databases. However I have struggled to connect to this. I have tried to load the extension JDBC driver from oo but the driver fails to install with an error 'loading of the component library failed'. I have tried the ODBC connection but again I have hit a brick wall not knowing the name of the ODBC data source on my system - or how to set one up. I concluded you needed to be an IT expert to be able to use a connection to a mysql database and gave up - I am not an IT expert. So I decided to try the route of using the database embedded in Base.
Please if someone can guide me how to connect to my existing mysql database this would be my preferred route as I have the back up of uysing phpmyadmin to sort out any issues if Base plays up.
OpenOffice 4.1.5 on Windows 10
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Primary Key not Saved

Post by UnklDonald418 »

Try LibreOffice instead of OO, there is a 64bit version that may connect with your Mysql database.
https://www.libreoffice.org/download/download/
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
rhammer54
Posts: 12
Joined: Sat Jan 04, 2020 1:52 pm

Re: Primary Key not Saved

Post by rhammer54 »

I have overcome the problem in that I have managed to connect to my mysql database using the ODBC connector. My problem was not knowing the parameters to enter in the ODBC connection wizard. I hadn't realised you needed to first create a connection using the ODBC data source administration manager. Found the answer elsewhere in this forum. So my original problem of the key not being saved has gone away.
I will close down the post.
Thank you all who replied.
OpenOffice 4.1.5 on Windows 10
Post Reply