Tags

Database Support

This page is meant to help you get up and running with your database. The lab has a few options for database solutions. You may want to first look at our ChoosingTheRightDatabaseSolution page.

MariaDB

For general database requirements, CLASSE supports MariaDB, an open source version of MySQL.

For practical purposes, MariaDB is interchangeable with MySQL, and any instructions referencing MySQL will work for MariaDB, which is meant to be a drop-in replacement.

The CLASSE MariaDB server is centrally located, backed up regularly, and accessible by anyone on the CLASSE network or beyond when used as the back-end of a web application. The MariaDB database, like MySQL, is widely supported by programming and scripting languages.

Putting your data in a MariaDB database at CLASSE means you do not have to worry about losing it. It's centrally located so anyone on the network can access it. It's automatically backed up. It's not locked into any vendor's format requiring a specific piece of software to access it. And it offers a lot of flexibility.

For example, you could update or build the database with one type of software, continue developing it with another, or write your own application to interact with the data. Also MariaDB is ready to be used either strictly on a desktop and/or as a back end database for a web site.

Requesting a Database

To request a database, please email service-classe@cornell.edu and include a description of how you intend to use the database.

CLASSE IT will provide you with database connection information including:

  • Host/Server Name
  • Port Number
  • User Name
  • Password

Database Clients

There are a variety of ways to connect to a database at CLASSE.

Depending on your database experience, we recommend using the mysql client, DBeaver (Community Edition) or LibreOffice Base. Users familiar with software like FileMaker or Microsoft Access will find the same types of functionality in Base. The mysql client is for users familiar with writing SQL queries on the command line. And finally, DBeaver is a database administration tool that falls between the mysql client and Base that provides a GUI interface to the database but doesn't offer form or report creation, for example.

MySQL

You should be able to connect to the database using the mysql client from any CLASSE computer.

mysql -h <your_hostname> -p -u<your_user_name>

The command above will connect you to the host you specify (-h) as the user you specify (-u) and will prompt you for that user's password (-p). If you do not specify a user the user that you are logged in as will be used. Run man mysql for more detailed help information.

You can also write perl, python, or bash scripts to interact with your database. And you can write desktop or web applications in just about any programming language, because MariaDB/MySQL is a widely known and supported database.

LibreOffice Base

Base can be used to provide a graphical front end to a MySQL database, complete with table design, forms, and reports (similar to Microsoft Access). To connect to a MySQL database using Base, please follow these steps:

Add the jdbc connector to your Libreoffice configuration on a CLASSE Linux system
  1. Start Libreoffice from CLASSE_GRID2 by selecting "Libreoffice"
  2. Click on the Tools menu item and choose Options...
  3. Under Libreoffice choose Advanced
  4. Click on Class Path...
  5. Click on Add Archive...
  6. Browse to /nfs/opt/mysql/mysql-connector-java-bin.jar. click on Open.
  7. Click OK, OK, and OK.
  8. Exit libreoffice

Connect to your MySQL database
  1. Start Libreoffice from CLASSE_GRID2 by selecting "Libreoffice"
  2. Create a new database in Libreoffice by clicking on "Base Database" or navigate to File->New->Database.
  3. Select Connect to an existing database and choose MySQL. Click on Next>>.
  4. Select Connect using JDBC ... and click on Next>>.
  5. Click on Test class to make sure the JDBC driver was loaded properly as above.
  6. Enter the name of the database, the Server URL (generally classedb.classe.cornell.edu), and the Port number (generally the default, 3306). Click on Next>>.
  7. Enter the User Name and check Password required.
  8. Click on Test Connection to make sure everything is OK up to this point. Click on Next or Finish
  9. If you clicked on Next above, choose Yes, register the database for me if you would like to access the database from other openoffice programs (for example, from a spreadsheet). Check Open the database for editing and click on Finish.
  10. Choose where to save and what to name the libreoffice database file you just created.
Topic revision: r12 - 02 Jun 2021, DevinBougie
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CLASSE Wiki? Send feedback