WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Problems with MariaDB 10.3  (Read 276 times)

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 90
Problems with MariaDB 10.3
« on: March 04, 2019, 05:31:21 PM »
First question:

Does it require mariadb-client in order to actually do something other than start it?

The .info files are not very intuitive, and I haven't been able to get it working.  The earlier version, with the client work.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6298
Re: Problems with MariaDB 10.3
« Reply #1 on: March 04, 2019, 05:52:08 PM »
Hi TomyTurbos
Looking at the  .list  file:
http://tinycorelinux.net/10.x/x86/tcz/mariadb-10.3.tcz.list
it appears the client may be included. The list includes:
Code: [Select]
/usr/local/mysql/bin/mysql
/usr/local/mysql/bin/mysqldump
/usr/local/mysql/bin/mysqldumpslow
The  mariadb-client.tcz  package may not be compatible with the newer version.

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 90
Re: Problems with MariaDB 10.3
« Reply #2 on: March 04, 2019, 06:26:11 PM »
Hi TomyTurbos
Looking at the  .list  file:
http://tinycorelinux.net/10.x/x86/tcz/mariadb-10.3.tcz.list
it appears the client may be included. The list includes:
Code: [Select]
/usr/local/mysql/bin/mysql
/usr/local/mysql/bin/mysqldump
/usr/local/mysql/bin/mysqldumpslow
The  mariadb-client.tcz  package may not be compatible with the newer version.

That's what I thought.  BUT, after loading mysqld in via /opt/bootsync as
Code: [Select]
/usr/local/mysql/bin/mysqld_safeas per the instructions, 'mysql' (from the same directory) reports as not found.

It DID work when I installed mariadb and mariadb-client though (and not mariadb10.3).

It's starting to look like andyj made a mistake maybe?
« Last Edit: March 04, 2019, 06:34:53 PM by Rich »

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6298
Re: Problems with MariaDB 10.3
« Reply #3 on: March 04, 2019, 06:34:17 PM »
Hi TomyTurbos
... 'mysql' (from the same directory) reports as not found. ...
If  /usr/local/mysql/bin/  is not part of your path then you need to call it as  /usr/local/mysql/bin/mysql.

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 90
Re: Problems with MariaDB 10.3
« Reply #4 on: March 04, 2019, 06:56:29 PM »
Hi TomyTurbos
... 'mysql' (from the same directory) reports as not found. ...
If  /usr/local/mysql/bin/  is not part of your path then you need to call it as  /usr/local/mysql/bin/mysql.

Hmm... Seems strange that after cd'ing into that dir (/usr/local/mysql/bin) an explicit path would be necessary.

Nonetheless, entering it as
Code: [Select]
/usr/local/mysql/bin/mysql now results in
Code: [Select]
error while loading shared libraries: libcursesw.so.5 (etc)

Offline andyj

  • Hero Member
  • *****
  • Posts: 676
Re: Problems with MariaDB 10.3
« Reply #5 on: March 04, 2019, 07:04:57 PM »
That will take a little while to fix. The cursed ncurses curse rears it's ugly head again. MariaDB takes two hours to compile.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6298
Re: Problems with MariaDB 10.3
« Reply #6 on: March 04, 2019, 07:05:56 PM »
Hi TomyTurbos
Hmm... Seems strange that after cd'ing into that dir (/usr/local/mysql/bin) an explicit path would be necessary.
In Linux, if you are in the directory you can preface the command with  ./  like this:
Code: [Select]
./mysql
Quote
Code: [Select]
error while loading shared libraries: libcursesw.so.5 (etc)
Maybe it needs  ncurses5.tcz ?

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 90
Re: Problems with MariaDB 10.3
« Reply #7 on: March 04, 2019, 07:53:26 PM »
Hi TomyTurbos
Hmm... Seems strange that after cd'ing into that dir (/usr/local/mysql/bin) an explicit path would be necessary.
In Linux, if you are in the directory you can preface the command with  ./  like this:
Code: [Select]
./mysql
Quote
Code: [Select]
error while loading shared libraries: libcursesw.so.5 (etc)
Maybe it needs  ncurses5.tcz ?

I'll just say that the './' preface seems goofy to me, but if that's the Linux way, so be it.

As for the cursed ncurses, I installed that and now get
Code: [Select]
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock(2)'
I don't know if andyj needs to know this before he spends the next two hours compiling, but at least we're making progress!

Point of interest:  My understanding is that it is more conventional to use /var/run as a location for sockets, and more secure than using /tmp.  YMMV.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 2841
Re: Problems with MariaDB 10.3
« Reply #8 on: March 04, 2019, 10:08:06 PM »
In Linux, if you are in the directory you can preface the command with  ./  like this:
Code: [Select]
./mysql
I'll just say that the './' preface seems goofy to me, but if that's the Linux way, so be it.

On the contrary, the ./ has a very specific and helpful meaning.   it means in the current working directory.  Whereas ../ means the parent directory.     If mysql is located outside of the PATH variable simply typing mysql wouldn't be enough to launch it, a path needs to be specified.    Rather than specify the full path, you can use ./your_executable  instead which provides the path to the executable (if the executable is in the current working directory).
That's a bit of a long winded answer, but you'll figure out soon enough how useful it can be.
:)     
« Last Edit: March 04, 2019, 10:10:43 PM by coreplayer2 »

Offline andyj

  • Hero Member
  • *****
  • Posts: 676
Re: Problems with MariaDB 10.3
« Reply #9 on: March 05, 2019, 06:41:05 AM »
Did you create and start a database using something like the following?

Code: [Select]
/usr/local/mysql/scripts/mysql_install_db --no-defaults --basedir=/usr/local/mysql --datadir=/path/to/database/dir
sudo /usr/local/mysql/bin/mysqld_safe --basedir=/usr/local/mysql --datadir=/path/to/database/dir --syslog --user=tc &

The socket is in the default location. It won't exist until the database is started. You can change the location in the config file:

Code: [Select]
tc@box:/usr/local/mysql/bin$ ./mysql --help
./mysql  Ver 15.1 Distrib 10.3.13-MariaDB, for Linux (i686) using readline 5.1
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Usage: ./mysql [OPTIONS] [database]

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
The following groups are read: mysql client client-server client-mariadb
...

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 90
Re: Problems with MariaDB 10.3
« Reply #10 on: March 05, 2019, 09:02:58 PM »
Did you create and start a database using something like the following?

Code: [Select]
/usr/local/mysql/scripts/mysql_install_db --no-defaults --basedir=/usr/local/mysql --datadir=/path/to/database/dir
sudo /usr/local/mysql/bin/mysqld_safe --basedir=/usr/local/mysql --datadir=/path/to/database/dir --syslog --user=tc &

The socket is in the default location. It won't exist until the database is started. You can change the location in the config file:

Code: [Select]
tc@box:/usr/local/mysql/bin$ ./mysql --help
./mysql  Ver 15.1 Distrib 10.3.13-MariaDB, for Linux (i686) using readline 5.1
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Usage: ./mysql [OPTIONS] [database]

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
The following groups are read: mysql client client-server client-mariadb
...

Cool. I seem to have a grip on this and resolved the problem (I think...). And of course, thanks!

While I have your attention I will just add that if you have not yet repackaged the tcz, mariadb is up to v10.3.13 already.  Maybe you can save yourself a step by knowing this.

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 90
Re: Problems with MariaDB 10.3
« Reply #11 on: March 05, 2019, 09:08:26 PM »
In Linux, if you are in the directory you can preface the command with  ./  like this:
Code: [Select]
./mysql
I'll just say that the './' preface seems goofy to me, but if that's the Linux way, so be it.

On the contrary, the ./ has a very specific and helpful meaning.   it means in the current working directory.  Whereas ../ means the parent directory.     If mysql is located outside of the PATH variable simply typing mysql wouldn't be enough to launch it, a path needs to be specified.    Rather than specify the full path, you can use ./your_executable  instead which provides the path to the executable (if the executable is in the current working directory).
That's a bit of a long winded answer, but you'll figure out soon enough how useful it can be.
:)   

It still seems odd to a person coming from the MicroSquish world where the PWD is pre-pended to the path, but thank you for the explanation.  I'll try to remember that in the future.