Welcome!

Linux Containers Authors: Liz McMillan, Robin Miller, Bob Gourley, XebiaLabs Blog, Yeshim Deniz

Related Topics: Linux Containers

Linux Containers: Article

Making MySQL, ODBC & OpenOffice 1.0 work together, Part 2

25-gazillion easy steps to making mailmerge work with OpenOffice & MySQL

(LinuxWorld) — The forum postings on last week's column about the installation of MySQL and ODBC to gain access to the secret power of OpenOffice.org 1.0 were a mixed bag: some good, some bad, some "so what." I was variously described as an stupid, foolish, an incompetent sysadmin and a writer of more fiction than fact.

I'll come clean about one thing: I am an incompetent sysadmin, and I have a failing score on the first LPI exam to prove it. But then so are most small businesspeople in the SOHO market. That makes my experiences a more-valuable litmus test for SOHO users than those of some yahoo guru running gentoo.

If you dismiss the name-calling and those who suggest switching to their distribution of choice in order to tame the problem, some valuable information remains to be gleaned. Among other things, I found a better, cleaner and "distribution-pure" installation method for Red Hat 8.0. It has only a couple of gotchas. Regardless of the distribution you're using, you might find help for how to get MySQL/ODBC installed and working with OpenOffice.org scattered in that forum.

If you're running Red Hat 8.0, the steps I followed might work for you. They are:

  1. up2date mysql mysql-server and mysql-devel
  2. /usr/bin/mysql_install_db
  3. chown -R mysql.mysql /var/lib/mysql
  4. chmod -R 666 /var/lib/mysql
  5. /usr/bin/safe_mysql -u mysql &
  6. up2date unixODBC unixODBC-devel
  7. up2date --src MyODBC
  8. rpmbuild --rebuild /var/spool/up2date/MyODBC-2.50.39-7.src.rpm
  9. rpm -Uvh --force /usr/src/redhat/RPMS/i386/MyODBC-2.50.39-7.i386.rpm
  10. Edit /etc/odbc.ini and /etc/odbcinst.ini

For whatever reasons, whenever I tried it with all the packages listed in a single up2date, it didn't work. It may have been the way I was holding my mouth, or I might not have sanitized my system completely from one of the previous failed installations. Or possibly up2date doesn't handle things correctly when there are too many packages under the tree. Hopefully it will work for you, too. As was explained in the forum, the reason for having to rebuild MyODBC is that the latest binary RPM for MyODBC does not yet match changes made in unixODBC for security problems.

There were also complaints about my suggesting a conflict of interest at MySQL AB between making money and making MySQL easy to install and configure. I would like to clarify my position. I did not say MySQL AB was failing to document MySQL more adequately in order to make more money selling support. What I said was that there is a conflict between the goals of the business and free software. It may or may not influence behavior, but it certainly exists. The goal of a business is to make money. The larger the market, the more money that can be made. Writing better documentation might very well shrink the market interested in MySQL AB products and services.

Moving right along

Enough of what happened last week. This week is all about actually using the MySQL/OpenOffice connection, not cussing while installing it or fussing about the best way to do it. For my test, I decided to do something that I had done circa 1995/1996 using both MS Access and the Lotus Approach — that being to create a table of newsletter subscribers and to use it to a mailmerge.

OpenOffice.org provides an easy-to-use tool for designing database tables. Clicking on View->DataSources brings up the Data Explorer, which lets you view and work with links, queries and tables in your data sources. I clicked on the MySQL-test data source to expand it, then selected tables and clicked the plus sign. Then a right-click on tables produced the Table Design window you see below. A couple of minutes later, I had a simple name and address table for newsletter subscriptions.

OpenOffice Table Design window
Editor's note: The above image is reduced in size to allow it to display on this page. Click on this image to see the original.

Now on to the heart of the matter: printing address labels from the table just created. I admit to getting stuck on this step for more than a full day. Relying primarily on the Help system, I followed the steps outlined but had no success. In addition to the steps being anti-intuitive, they also have the disadvantage of just not working. The best I could with them was to print every other label. I know, I know. You can say the glass is half-empty or half-full. But I wanted them all.

I asked for help using IRC in both the #openoffice.org and the #mysql channels on irc.freenode.net. But there was no help. Not even a suggestion. I Googled and read search results, but I couldn't find a mention of this problem (or even a similar one). Worse, I didn't know if I was dealing with a MySQL problem, an ODBC problem or an OpenOffice.org problem.

Finally, I joined OpenOffice.org so that I could search existing bugs. They track issues, not bugs, but it didn't help. Finally I decided to search the users mailing list archive. When I did, the problem became as plain as the nose on my face. The problem is that the Help system docs are wrong. Period. They don't work.

Success? Success!

I did find instructions there that work. I want to mention a small "gotcha" before proceeding. When I first began trying to print the address labels, I got a MySQL error message for "Too many connections." I learned that each label on the page requires a connection of its own. I did two things to resolve the problem. It's possible that only one of them was required. First, I added this line to the mysqld section of /etc/my.cnf:

set-variable = max_connections=200

After killing the running processes, I did an su mysql before restarting.0 I had found a note in a Google search from a MySQL developer who suggested not starting mysqld as root might solve the "Too many connections" problem. I restarted as user mysql instead of root passing a user argument on the command line. After the changes, database access worked. More experimentation is required to figure out which one actually cured the ill.

Here are the instructions on how to print the labels.

  1. Choose File->New->Labels
  2. Select the Labels tab and pick the columns from the table you want printed on the label, left to right, line by line. Be sure to enter space between adjacent columns on the same line and to press Enter to continue on a new line.
  3. Select the Format tab and define the way you want the labels to print: the size, margins and number of columns and rows you want per page.
  4. Select the Options tab and unselect Synchronize
  5. Click on New Document
  6. Press F4 to select the data source
  7. Select the rows from the table that you want included by clicking on the button to the left of the leftmost column of the table display. Use the Shift and CTL keys as you normally do for selecting multiple items.
  8. Click on the "Data to Fields" icon on the database toolbar. Just to the left of this icon is a very similar one. You want the one on the right, which is immediately adjacent to the Form Letter icon. When you click it, the document fields will be populated from the database.
  9. Click on the Form Letter icon and follow the dialog to print the labels.

Final impressions? OpenOffice.org is more sophisticated and powerful than I realized. It can be made to work with various database-management systems, and it can do the mailmerge functions required by many SOHO types. Ease of use is not up to what I remember with either Access or Approach six or seven years ago, but I'm sure that it will continue to improve in that regard. The good news to me is that Linux is making strong strides not just in the enterprise, and not just on the desktop, but in a place where it seems to lag most of all: the SOHO market.

If you need database access and manipulation for your SOHO office environment, I would not recommend an immediate switch to OpenOffice.org. I would very strongly recommend that you begin beta tests of it — perhaps with more than one DBMS — to see if it meets your needs. Exercise it fully. You don't want to get to the tail-end of an implementation only to find another "gotcha" that makes the whole thing unsuitable. As with all software, there are bound to be bugs in both the code and the documentation. I'll continue my own investigations and compare my experiences with both PostgreSLQ and the OpenOffice.org default, dBase.

More Stories By Joe Barr

Joe Barr is a freelance journalist covering Linux, open source and network security. His 'Version Control' column has been a regular feature of Linux.SYS-CON.com since its inception. As far as we know, he is the only living journalist whose works have appeared both in phrack, the legendary underground zine, and IBM Personal Systems Magazine.

Comments (6) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
lawrence harriott 02/24/05 09:58:59 AM EST

Oh, I am using Mandrake 10.1, OOo1.1.4, MySQL3.51. I installed the unixODBC drivers that come with linux.

lawrence harriott 02/24/05 09:55:35 AM EST

This is one of the few places where success with OOo and MySQL have happened. After a sleepless week of working at this problem, with precious but little help I wound up here.

My problem is that from early on I have been able to create tables in MySQL using OOo but up to now cannot see any when I access my data sources. I connect to the database but the tables in there will not show up no matter what I do.
So far I have added myslef to the mysql group, made the test database permission read/write to all, checked the table with isql and mysql (it is there and I can do what i want with it).

If anyone had solved this problem please, please, let me know how to correct this.

Thanks
Lawrence

Leslie Viljoen 03/25/04 07:03:58 AM EST

I used this article to set up MySQL/OpenOffice connectivity under Mandrake 9.1 - in about 30 minutes.
I needed to urpmi unixODBC-gui-gtk and MySQL had already been installed earlier (but I hadn't done anything with it).
Apart from that I just put in the odbc.ini and odbcinst.ini lines and everything worked.

Thank-you for the tips!

Leslie

Muraille Paul 12/07/03 04:09:29 PM EST

Maybe a look at the Database FAQ (http://dba.openoffice.org/FAQ/FAQ.html#dataupdate)
might help you. There's one question that reads:
"I can access my tables with OOo, but I can't update or insert any data - the access seems to be read-only." However, it seems that it was written for OOo 1.0 and you may need more drilling (in the answer, they say there's a turnaround for 1.1 beta2 and they explain it on another page).
As to me, I have OOo 1.1 (French version), mySQL 4.0.15 (installed together with Apache, see EasyPHP 1.7) and I downloaded the mySQL ODBC component from mySQL AB available on the mySQL website. After configuring the ODBC driver through the control panel, I ran OOo, then configured a datasource for a local mySQL database named 'test' as the 'root' user and everything was ok. So if you haven't done so yet, test your connection as the 'root' user. If it works, your problem may be a user's read/write problem as explained in the FAQ.

Hope this helps,

Paul

Joel Stone 10/27/03 07:42:42 PM EST

Gosh, I wouldn't have a clue about how to make any of that work on windoze, sounds like quite a mess... would yu be willing to consider the linux OS? Perhaps use crossover office to operate the handful of pesky legacy windoze apps for now?

Mike Darrett 10/27/03 12:21:58 PM EST

Hello,

I'm trying to run OpenOffice.org 1.1 with MySQL on Windows 98. (Yes yes I know, but some things like eBay's Mister Lister, not to mention TaxCut, only work on Windows.)

I've followed the McCreesh article, and cannot enter data into a newly-made table. (I've installed MyODBC instead of unixODBC.) I can create a new table, but I can't seem to edit the table at all; all record options are grayed out.

Any suggestions?

Thanks

Mike

@ThingsExpo Stories
The age of Digital Disruption is evolving into the next era – Digital Cohesion, an age in which applications securely self-assemble and deliver predictive services that continuously adapt to user behavior. Information from devices, sensors and applications around us will drive services seamlessly across mobile and fixed devices/infrastructure. This evolution is happening now in software defined services and secure networking. Four key drivers – Performance, Economics, Interoperability and Trust ...
Data is an unusual currency; it is not restricted by the same transactional limitations as money or people. In fact, the more that you leverage your data across multiple business use cases, the more valuable it becomes to the organization. And the same can be said about the organization’s analytics. In his session at 19th Cloud Expo, Bill Schmarzo, CTO for the Big Data Practice at Dell EMC, introduced a methodology for capturing, enriching and sharing data (and analytics) across the organization...
SYS-CON Events announced today that T-Mobile will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
The explosion of new web/cloud/IoT-based applications and the data they generate are transforming our world right before our eyes. In this rush to adopt these new technologies, organizations are often ignoring fundamental questions concerning who owns the data and failing to ask for permission to conduct invasive surveillance of their customers. Organizations that are not transparent about how their systems gather data telemetry without offering shared data ownership risk product rejection, regu...
Bert Loomis was a visionary. This general session will highlight how Bert Loomis and people like him inspire us to build great things with small inventions. In their general session at 19th Cloud Expo, Harold Hannon, Architect at IBM Bluemix, and Michael O'Neill, Strategic Business Development at Nvidia, discussed the accelerating pace of AI development and how IBM Cloud and NVIDIA are partnering to bring AI capabilities to "every day," on-demand. They also reviewed two "free infrastructure" pr...
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists will examine how DevOps helps to meet th...
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place June 6-8, 2017, at the Javits Center in New York City, New York, is co-located with 20th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry p...
With billions of sensors deployed worldwide, the amount of machine-generated data will soon exceed what our networks can handle. But consumers and businesses will expect seamless experiences and real-time responsiveness. What does this mean for IoT devices and the infrastructure that supports them? More of the data will need to be handled at - or closer to - the devices themselves.
Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the USA and Europe, we work with a variety of customers from emerging startups to Fortune 1000 companies.
Financial Technology has become a topic of intense interest throughout the cloud developer and enterprise IT communities. Accordingly, attendees at the upcoming 20th Cloud Expo at the Javits Center in New York, June 6-8, 2017, will find fresh new content in a new track called FinTech.
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more business becomes digital the more stakeholders are interested in this data including how it relates to business. Some of these people have never used a monitoring tool before. They have a question on their mind like “How is my application doing” but no id...
SYS-CON Events announced today that Juniper Networks (NYSE: JNPR), an industry leader in automated, scalable and secure networks, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Juniper Networks challenges the status quo with products, solutions and services that transform the economics of networking. The company co-innovates with customers and partners to deliver automated, scalable and secure network...
The age of Digital Disruption is evolving into the next era – Digital Cohesion, an age in which applications securely self-assemble and deliver predictive services that continuously adapt to user behavior. Information from devices, sensors and applications around us will drive services seamlessly across mobile and fixed devices/infrastructure. This evolution is happening now in software defined services and secure networking. Four key drivers – Performance, Economics, Interoperability and Trust ...
In his keynote at @ThingsExpo, Chris Matthieu, Director of IoT Engineering at Citrix and co-founder and CTO of Octoblu, focused on building an IoT platform and company. He provided a behind-the-scenes look at Octoblu’s platform, business, and pivots along the way (including the Citrix acquisition of Octoblu).
SYS-CON Events announced today that Hitachi Data Systems, a wholly owned subsidiary of Hitachi LTD., will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City. Hitachi Data Systems (HDS) will be featuring the Hitachi Content Platform (HCP) portfolio. This is the industry’s only offering that allows organizations to bring together object storage, file sync and share, cloud storage gateways, and sophisticated search an...
@GonzalezCarmen has been ranked the Number One Influencer and @ThingsExpo has been named the Number One Brand in the “M2M 2016: Top 100 Influencers and Brands” by Analytic. Onalytica analyzed tweets over the last 6 months mentioning the keywords M2M OR “Machine to Machine.” They then identified the top 100 most influential brands and individuals leading the discussion on Twitter.
The Internet of Things is clearly many things: data collection and analytics, wearables, Smart Grids and Smart Cities, the Industrial Internet, and more. Cool platforms like Arduino, Raspberry Pi, Intel's Galileo and Edison, and a diverse world of sensors are making the IoT a great toy box for developers in all these areas. In this Power Panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists discussed what things are the most important, which will have the most profound e...
@ThingsExpo has been named the Most Influential ‘Smart Cities - IIoT' Account and @BigDataExpo has been named fourteenth by Right Relevance (RR), which provides curated information and intelligence on approximately 50,000 topics. In addition, Right Relevance provides an Insights offering that combines the above Topics and Influencers information with real time conversations to provide actionable intelligence with visualizations to enable decision making. The Insights service is applicable to eve...