NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Install MySQL on cRIO-9057 unsuccesful

Hi,

 

In order to evaluate cRIO-9057 performance, I'm migrating one of my RT applications from a cRIO-9036 to this new target. My application is using a local MySQL database. So I'm trying to install and configure a MySQL server on my target. My method is quite similar as the one explained in the attached pdf file, and approved on cRIO-9066, cRIO-9035 and cRIO-9036. Nevertheless, it seems that the MySQL server don't want to start correctly.

I attached a second file "ConsoleOutDuringInstallationViaWorkNetwork.txt" that is a copy/paste of the console out obtained during this installation.

 

Is somebody ever try to do it on a cRIO-905x ?

Is somebody can help me to understand what error messages means and what to do to fix this issue ?

 

Cdly,

Download All
0 Kudos
Message 1 of 15
(4,876 Views)

Hi steuveu,

 

I would not expect this to be specific to the 905x. In fact, I received the same error on a 903x target. Have you tried using MySQL with 2018 SP1 (18.5) versioning before? 

 

It appears that this is a bug in the Yocto/OE environment that NI uses to build NI Linux Real-Time. You can reference https://jira.mariadb.org/browse/MDEV-14044 to see the bug report and possible workarounds in the comments.

 

FYI NI Linux RT is currently based off of Pyro (Yocto Project Version 2.3) which has a release date of May 2017. This means that a fix to this bug report would not be a part of the 2018 SP1 version of NI Linux Real-Time.

 

Thanks,

Andy

0 Kudos
Message 2 of 15
(4,851 Views)

Hi Andy,

 

First, thanks for all your informations and links.

Indeed, this is the first time I try to use MySQL with 2018. I have no other option with this new cRIO.

 

Steve

0 Kudos
Message 3 of 15
(4,835 Views)

Hi andy 

I am working with steuveu, I try to install MariaDB on a 904x cRIO, and we have the same problem with 2018 SP1

 

Our knowledge on Linux and compilling are limited do you have tutorial or details to be able to recompile MariaDB with the patch ?

 

Regards

0 Kudos
Message 4 of 15
(4,809 Views)

Did anyone get this working? I have a project that will require a MySQL or MariaDB to be installed on a CRIO 9045.

 

Regards 

0 Kudos
Message 5 of 15
(4,425 Views)

I can report the bug is still in the feeds for 18.5. I had to downgrade to 17.

 

 

 

#
!includedir /etc/my.cnf.d
admin@NI-cRIO-9030-01C90598:/# /etc/init.d/mysqld start
Starting MySQL. SUCCESS! 
admin@NI-cRIO-9030-01C90598:/# mysql 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.50-MariaDB Source distribution

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit
Bye
admin@NI-cRIO-9030-01C90598:/# 

 

 

Edit on 3/11/20:

 

I just recently purchased 2 cRIO-9053s for a project. These units require LabVIEW 2018 and the feeds still seem to point to the broken MariaDB. Got the same ole "we don't support MSQL" from NI when I called about getting the feeds updated to address the fix implemented by MariaDB in 2017. Has anyone been successful at compiling MariaDB on the cRIO under 18 or 18.5?

 

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 6 of 15
(4,247 Views)

I can report back that the feeds for NI-RIO 20 have fixed the broken MariaDB package. It installs and functions as expected.

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 7 of 15
(4,039 Views)

Hi Doug,

 

I'm actually trying to install MySQL on a cRIO-9031 with Linux RT  System Image 20.5. mysq5 installation looks good. (no error reported) but I have  "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'"  when I try to connect. (mysql -u root -p)

Service looks running.

SteveLavaure_0-1611306355897.png

Could you give me more informations about what you did please ?

 

Thanks in advance,

 

steuveu

0 Kudos
Message 8 of 15
(3,552 Views)

After my installation, I don't use

 

#mysql -u root -p 

 

I use just

 

#mysql 

However, I am not sure that would cause the issue you are experiencing.

 

However I see some post with the same error code you are seeing:

 

phpmyadmin - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld...

 

Here are the notes I made when setting it up with 17 feeds and then again with 20 feeds:

 


Before we start, if you have not updated opkg in a while, you should probably do that first:

#opkg update

After update the package list from the NI repository http://download.ni.com/ni-linux-rt/feeds/2017, we can install MySQL. There is already an opkg package in the list so, run the following comand:

#opkg install mysql5

This process will take a while beginning with downloading several packages and supporting libraries.

Once the installation is complete, to start the MySQL server, you should type:

#/etc/init.d/mysqld start

Theoretically, the installation already starts the MySQL service but this is a way to ensure that is running.

If the installation is successful, we will see the message Starting MySQL SUCCESS! and we can log into the MySQL local server just typing:

#mysql

 

MySQL - Remote Connections

Once connected you need to edit the MySQL server configuration file my.cnf using a text editor such as vi:

#vi /etc/my.cnf

Once file opened, locate line that read as follows:

[mysqld]

And make sure line skip-networking is commented including a hashtag at the beginning (or remove the line):

# skip-networking

and add following line

bind-address=<cRIO IP Address>

For example, if your MySQL server IP is 10.0.0.5 then entire block should be look like as follows:

[mysqld]

user = mysql

pid-file = /var/run/mysqld/mysqld.pid

socket = /var/run/mysqld/mysqld.sock

port = 3306

basedir = /usr

datadir = /var/lib/mysql

tmpdir = home/lvuser/mysql.tmp

language = /usr/share/mysql/English

bind-address = 10.0.0.5

# skip-networking

 

Where,

  • bind-address: IP address to bind to.
  • skip-networking: Don’t listen for TCP/IP connections at all. All interaction with mysqld must be made via Unix sockets. This option is highly recommended for systems where only local requests are allowed. Since you need to allow remote connection this line should be removed from my.cnf or put it in comment state.

Save and Close the file, and restart the mysql server:

# /etc/init.d/mysqld restart

  

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 9 of 15
(3,536 Views)

Hi,

 

I need to manually start mysql, #/etc/init.d/mysqld start  

i think i have a user config problem 

i have a mysql user existing on my system:

mysql:x:399:399::/var/mysql:/bin/false

 

is there something else to do ?

 

0 Kudos
Message 10 of 15
(3,505 Views)