Chef recipe database specifies a downlevel MySQL. How should I handle that? - mysql

I am using the latest MySQL Chef recipe to install MySQL server. I want to create a database next. The database recipe specifies MySQL ~> 5.0.
How does one deal with those version dependencies? I can try to change the dependency for the database recipe and see whether it will still work, but that does not feel right.
What is considered best practice for that?

Its unclear if you're talking about mysql version or cookbook versions.
But I'll assume you're talking about cookbooks.
Database cookbook depends on mysql cookbook in version 5.0.x which may install mysql in version 5 to 5.6.
The mysql cookbook has been bump to 6 (major change), it means it has breaking changes with previous major version.
The database cookbook was not tested (or tested and failed) with mysql cookbook in V6.
For the global 'how to deal with that' the best answer in my point of view is to have a wrapper cookbook for your database which will depend on the database cookbook.
That will take care to install mysql and what is needed for your DB when you call your recipe (you may tweak mysql install by attributes in your wrapper cookbook and include specific recipes not in default path if you need them).
I think your main problem here is seeing the mysql install and the db creation as two separate things but in fact the mysql server install is just a prerequisite of your database creation.

Related

Confused with different types of MySQL applications to install

I'm very new to MySQL.
My question is about installation of MySQL on my Mac (Mojave OS) to learn and practice it to later use it with node.js.
First I got it with Homebrew, but then I wasn't able to use it with the Workbench - I set up the password for root user but I didn't find any commands list to work with it since it refused to do any operations with it in workbench and I didn't find any command.
Then I downloaded Community Server - I have a server through system prefs, but I don't have a command line interface - which I need for writing queries.
After that I downloaded MySQL Shell. But as far as I researched I found that is it not standard CLI (found it here https://stackoverflow.com/questions/58367813/how-to-uninstall-mysql-shell-on-macos).
My question is next.
As an example, when I started learning MongoDB I had MongoDB Compass and MongoDB Shell - one helped me to work with commands, the other one helped to see results visually.
MySQL has a language which I want to learn and practice with (SELECT, USE etc.). How can I do the same what I did with MongoDB but in the case of MySQL? What should I install, and why Homebrew MySQL version is different than any other MySQL version (even commands - such as mysql.server start) and there is no documentation for it in MySQL docs?
Unfortunately, there's no such nice installer for macOS as there is for Windows. Instead you have to install the different parts individually.
For the type of work you plan to do I recommend to install at least 2 pieces:
The MySQL server, which holds your data. On macOS this comes with a preferences pane, which you can use do some basic management of the server (start/stop, directory settings).
MySQL Workbench, a visual design, query and management tool. That will give you GUI support for your DB work.
The server also comes with the classic shell, which you can launch by running mysql in a terminal. That's sometimes quicker for simple work, compared to launching a full GUI.
A better command line tool is the MySQL Shell, a new and highly improved variant of the classic shell, which will eventually replace the old classic shell entirely in the future. So it's certainly no mistake to install that too.
I hope that clarifies which pieces are required to start working with MySQL.

Will mysql version change affect migration?

I want to transfer my Ruby on Rails project to another platform.
Currently my RDS is running over mySQL 5.5 which is discontinued, will it be ok to utilize mySQL 5.7 instead and will database migration be affected?
What could be consequences?
Mysql does not support direct upgrade skipping versions, so you'll have to upgrade in steps: 5.5->5.6->5.7, and then, maybe, 8 (actually, sometimes for simple databases a 5.5->5.7 jump might work, but it is not guaranteed and you may loose data).
make a backup
You need to have compatible mysql2 gem version (fresh enough)
See MySQL changes(5.6 and 5.7) and corresponding upgrade guides to:
make your app compatible (replace deprecated/removed features, adapt for new defaults etc.)
migrate data and mysql itself (if your database is big or under constant load, logical dumping+loading might not be acceptable), usually it involves upgrading to most recent patch version and then jumping to next version, sometimes running mysql migration tool
plan for a downtime (in worst case - a backup restore)
To minimize downtime - you can make use of mysql's ability to create a mixed-version cluster (add 5.6 slave to your present 5.5 master, then promote in to master, and so on)

SonarQube 6.1 not calculating lines of code after upgrade and database migration

tl;dr: SonarQube calculates lines of code metric for some projects but not others after an upgrade.
Hello everyone,
I recently took over an orphaned SonarQube 5.1 installation running on MySQL 5.1 on another server. When I upgraded SQ to 5.6.2 it told me that it required MySQL 5.6. Because the servers in question are CentOS 7 that version of MySQL is not available through yum. Use of yum is required for installing software. I installed PostgreSQL on the SQ server and, because I did not want to lose SQ history and configuration, migrated the database from MySQL to Postgres using pgloader (see pgloader.conf in code block below). The migration appeared to have worked as the schema changes 5.1->5.6.2 succeeded as did 5.6.2->6.1.
LOAD DATABASE
FROM mysql://USER:PASSWORD#mysqlhost.my.com/sonar
INTO postgresql://USER:PASSWORD#pghost.my.com/sonar
with create indexes, preserve index names;
However, some projects that existed before the upgrade and migration and also some projects that have been added (through Jenkins) after the migration never have the Lines of Code metric calculated. These are primarily but not exclusively C# files.
I don't see any way to "reset" a project in the UI or web API. If I could export the SQ configuration, I would wipe the database and reload, but I don't see a way to do that either. Starting from scratch is undesirable. Any help is greatly appreciated.

Is there a MySQL seed database dump for Adempiere ERP 380

I was looking into trying out Adempiere 380 LTS specifically with MySQL. Is there a seed database anywhere that I can use? There used to be one for 360 but I'm not sure if it's still compatible (probably not).
If not any suggestions on a work around. I've started a migration of a seed PostgreSQL to MySQL but the process is slow as it requires quite a bit of manual intervention from the looks of it.
There isn't one at the moment.
The latest MySQL dump, that I can see, is available here.
You would need to either successfully migrate latest PosgreSQL database over MySQL (there's something called pg2mysql, mysql workbench also has a migration tool) or try to adapt 360's MySQL dump to the latest version of Adempiere.
Whatever the option, there's going to be quite a bit of manual work to get it working 100%.

Is it safe to replace MySQL to Percona Server with XtraDB on Debian Lenny?

I would like to replace MySQL 5.1 on my Debian Lenny 32-bit server to Percona Server with XtraDB. The main reason is better performance of Percona.
It's production server with many services running. Many other software may depend on mysql-client and other mysql shared libraries.
Is it safe to replace MySQL?
By "safe" I mean: 1. remove mysql, 2. install percona 3. everything works as before
Will it break dependencies in third party software?
Will it require to change configuration of third party software (ie. socket path, server port, shared libraries path)?
Will it require to install trillion of additional packages?
I really don't want situation with broken libraries, missing or incompatible header files and so on
We are currently in the process of upgrading from MySQL 4.1 to Percona Server 5.5 at work and Percona is as they say on their site a complete drop-in replacement for MySQL, the binaries use the same names, it uses the same libraries, same config file placement, takes the same parameters and it has exactly the same SQL syntax. They should also be data file compatible on the same version (MySQL 5.1 to Percona 5.1, etc) but it's nothing I've personally verified.
You are able to do an apt-get install percona-server-server-5.1 after adding their repositiories and it will automatically replace MySQL because it marks it as a conflicting package. But you must take an SQL dump of your database first, of course.
We currently have replication set up from a MySQL 4.1 master to a couple of Percona 5.5 slaves and have had no problems inserting SQL dumps either.
... don't know.
In my experience, the only way is to make up a copy of your existing setup on an old machine and run some tests. Then swap over to the new DB and run same tests again.
I just swapped a set of applications from Tomcat 5 to Tomcat 6 and in theory, with one or two tweaks, all should have worked fine. First time I tried it OpenJava was installed and the garbage collection fouled things up. Second time around with Sun Java, some dodgy date handling fouled things up and had to be corrected, seems to run fine now.