Skip to content

setting up pasa mysql

Brian Haas edited this page Aug 6, 2021 · 6 revisions

Setting up MySQL for use with PASA

Linux (easiest)

this Linux documentation is a work in progress... It's fairly straightforward, and I'm currently providing the very basic steps involved.

If you're using 'ubuntu' linux, an 'apt-get install mysql' will probably do the trick.

For the perl module DBD::mysql, running 'cpanm install DBD::mysql' and perhaps 'cpanm install DBI' is needed.

basic info on installing perl modules can be found here.

See the mysql configuration notes at bottom of page for remaining steps.

MacOS (harder than it should be, but doable)

Try using homebrew for installations. It's a life-saver IMHO for Mac software installations. Note these are instructions based on my latest experience doing this on MacOSX Mojave.

Install mysql

    brew install mysql

Install the mysql connector and openssl

   brew install openssl mysql-connector-c

Install the perl DBD::mysql module

   wget https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz

   tar xvf DBD-mysql-4.050.tar.gz
   
   cd cd DBD-mysql-4.050

   perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config
  
   make

   make install

Because there's now an issue with not being able to define environmental variables like LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH) and have it used on mac due to the new Mac System Integrity Protection, you'll need to sym-link the shared libraries directly to your /usr/local/lib/ area so they can be found by DBD::mysql

   cd /usr/local/lib
  
   ln -s /usr/local/mysql/lib/*dylib .

Now check that it works:

   perl -MDBD::mysql -e 'print "Hello there!";'

If the above doesn't error out, there's a good chance that it was set up correctly.

Mysql configuration

What I like to do here is to create proxy 'pasa' reader and writer accounts that everyone can leverage for working with PASA.

Start mysql as root:

   mysql -uroot 

If you need a root password, include the '-p' parameter. Sometimes, default mysql installations come w/o root passwords set (so be sure to set one soon, if you haven't, for your own protection). sometimes you need to run it as root like so: 'sudo mysql -uroot -p'

Creating users:

 
 # create a 'pasa_write' user destined for reading/writing/creating capabilities
 
 create user 'pasa_write'@'localhost' identified by 'pasa_write_pwd';

 # this below will allow user 'pasa_write' to create databases named with a _pasa suffix 
 # (and so not just any database name)
 
 grant all privileges on `%_pasa`.* to 'pasa_write'@'localhost';


 # create a 'pasa_access' user that we'll use for read-only database access.
 # this is useful for generating reports, pasa-web access, etc., where read-only is best.
 
 create user 'pasa_access'@'localhost' identified by 'pasa_access';
    

Note, these users and passwords should match what is specified in the 'PASA_HOME/pasa_conf/conf.txt' configuration file.

Clone this wiki locally