Entware mySQL installation issue

Marvell Kirkwood based
Post Reply
tmcatalin
Posts: 34
Joined: Mon Jun 04, 2012 7:22 am

Entware mySQL installation issue

Post by tmcatalin » Sun Apr 01, 2018 4:06 am

Hi,

I am trying a clean installation of ownCloud on my NSA325 v2 and i want to use mySQL.

So far i run successfully:

Code: Select all

root@NSA325:~# /opt/bin/opkg install mysql-server php7-mod-mysqli

Code: Select all

root@NSA325:~# /opt/bin/opkg install mysql-server php7-mod-mysqli
Package mariadb-server (5.5.58-1) installed in root is up to date.
Package php7-mod-mysqli (7.1.12-3) installed in root is up to date.
But when trying to run:

Code: Select all

root@NSA325:~# /opt/bin/mysql_install_db --force
i am receiving bellow error:

Code: Select all

root@NSA325:~# /opt/bin/mysql_install_db --force
Installing MariaDB/MySQL system tables in '/opt/etc/mysql/' ...
A newer kernel is required to run this binary. (__kernel_cmpxchg64 helper)
Aborted (core dumped)

Installation of system tables failed!  Examine the logs in
/opt/etc/mysql/ for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /opt/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /opt/bin/mysqld --skip-grant --general-log &

and use the command line tool /opt/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /opt/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /opt/etc/mysql/ that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira
Trying to follow the suggestion didn't help; BTW, i see no logs.
Searching over the internet didn't help either.

Any ideas how to solve this?

Thank you

PS: is anyone running ownCloud with SQLite? is it a working solution?

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Entware mySQL installation issue

Post by barmalej2 » Sun Apr 01, 2018 8:40 am

Entware targets kernel >=3.2 for armv5, so expect that more packages will be incompatible with your device and current 2.6.31.8 kernel. The only way (at least known to me) to install mariadb system tables is to recompile mariadb package with atomic built-ins disabled option: -DHAVE_GCC_ATOMIC_BUILTINS="", which might have influence for sql performance degradation.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: Entware mySQL installation issue

Post by MrDini » Sun Apr 01, 2018 1:53 pm

Hi,

I actually worked a lot with mariadb in the last few months, and I also ran into that issue. For me the solution was a

Code: Select all

mysqld --initialize
since the daemon supports natively the initializations from mysql 5.7.6. See the related docs for more informations. The mariadb is a mysql fork so that solution works with mariadb aswell.

Maybe it doesn't require the atomic builtins. If not, as barmalej2 already said, you've to recompile mariadb, or install FFp and use barmalej2's mariadb package.
tmcatalin wrote:is anyone running ownCloud with SQLite? is it a working solution?
Don't think so. At least I haven't tried it yet. But because sqlite databases are only one file things, if you have a bigger database, I don't recommend using that. Because it'll invoke your HDD more times than the other db alternatives.

BTW if ownCloud supports Postgresql, I'd recommend using that as database. It is the best relational db alternative So far IMO, and works perfectly on my NAS.

And also. If you're planning to replace the old ownCloud installation which comes from the zypkg installation, it'll be incredibly slow with a basic apache + modphp and mariadb installation. I've done a lot of optimizations, and I got a usable service, but it wasn't so fast either. So don't expect big things.
Thanks nas-central the lot of help! :)

tmcatalin
Posts: 34
Joined: Mon Jun 04, 2012 7:22 am

Re: Entware mySQL installation issue

Post by tmcatalin » Mon Apr 02, 2018 8:15 am

MrDini wrote:For me the solution was a

Code: Select all

mysqld --initialize
since the daemon supports natively the initializations from mysql 5.7.6. See the related docs for more informations.
I tried without success. BTW, your implementation is on NSA325v2?

Code: Select all

/i-data/37ba0db8/root # mysqld --initialize
A newer kernel is required to run this binary. (__kernel_cmpxchg64 helper)
Aborted (core dumped)
Thanks

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: Entware mySQL installation issue

Post by MrDini » Mon Apr 02, 2018 4:41 pm

Okay then no doubts. You have to recompile mariadb.

I used FFp where barmalej2 had a nice mariadb package. I just had to optimize the apache (webserver) and the PHP.
Thanks nas-central the lot of help! :)

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Entware mySQL installation issue

Post by Mijzelf » Wed Apr 04, 2018 6:45 pm

I managed to build a kernel module which basically injects the cmpxchg64 code from kernel 3.2 into the firmware kernel. On my '325 mysql now installs:

Code: Select all

/opt/bin/mysql_install_db --force
Installing MariaDB/MySQL system tables in '/opt/var/mysql/' ...
180404 20:37:31 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180404 20:37:31 [Note] /opt/bin/mysqld (mysqld 5.5.58-MariaDB) starting as process 8941 ...
OK
Filling help tables...
180404 20:37:32 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180404 20:37:32 [Note] /opt/bin/mysqld (mysqld 5.5.58-MariaDB) starting as process 8952 ...
OK
<snip>


@tmcatalin: I PM'ed you a downloadlink. Can you test it?

tmcatalin
Posts: 34
Joined: Mon Jun 04, 2012 7:22 am

Re: Entware mySQL installation issue

Post by tmcatalin » Mon Apr 09, 2018 6:53 am

Mijzelf wrote: @tmcatalin: I PM'ed you a downloadlink. Can you test it?
Sorry I just comeback from a short holiday and didn't check the forum.
I will try it today or tomorrow.
Thank you

tmcatalin
Posts: 34
Joined: Mon Jun 04, 2012 7:22 am

Re: Entware mySQL installation issue

Post by tmcatalin » Sat Apr 14, 2018 4:11 am

Mijzelf wrote:I managed to build a kernel module which basically injects the cmpxchg64 code from kernel 3.2 into the firmware kernel. On my '325 mysql now installs:

Code: Select all

/opt/bin/mysql_install_db --force
Installing MariaDB/MySQL system tables in '/opt/var/mysql/' ...
180404 20:37:31 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180404 20:37:31 [Note] /opt/bin/mysqld (mysqld 5.5.58-MariaDB) starting as process 8941 ...
OK
Filling help tables...
180404 20:37:32 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180404 20:37:32 [Note] /opt/bin/mysqld (mysqld 5.5.58-MariaDB) starting as process 8952 ...
OK
<snip>


@tmcatalin: I PM'ed you a downloadlink. Can you test it?
I loaded that module and the installation completed with the same warnings as in your example:

Code: Select all

/i-data/37ba0db8 # mysql_install_db --force
Installing MariaDB/MySQL system tables in '/opt/var/mysql/' ...
180414  6:16:57 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed                        in a future release.
180414  6:16:57 [Note] /opt/bin/mysqld (mysqld 5.5.58-MariaDB) starting as proce                       ss 28001 ...
OK
Filling help tables...
180414  6:16:57 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed                        in a future release.
180414  6:16:57 [Note] /opt/bin/mysqld (mysqld 5.5.58-MariaDB) starting as proce                       ss 28013 ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/opt/bin/mysqladmin' -u root password 'new-password'
'/opt/bin/mysqladmin' -u root -h NSA325 password 'new-password'

Alternatively you can run:
'/opt/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/opt' ; /opt/bin/mysqld_safe --datadir='/opt/var/mysql/'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/opt/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
nevertheless when trying to move forward I'm getting:

Code: Select all

/i-data/37ba0db8 # mysqld -u root -p
180414  6:38:49 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed                        in a future release.
180414  6:38:49 [Note] mysqld (mysqld 5.5.58-MariaDB) starting as process 30172                        ...
180414  6:38:49 [ERROR] mysqld: Can't lock aria control file '/opt/var/mysql/ari                       a_log_control' for exclusive use, error: 11. Will retry for 30 seconds
180414  6:39:20 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/opt/var/mysql/aria_log_control'
180414  6:39:20 [ERROR] Plugin 'Aria' init function returned error.
180414  6:39:20 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
180414  6:39:20 InnoDB: The InnoDB memory heap is disabled
180414  6:39:20 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
180414  6:39:20 InnoDB: Compressed tables use zlib 1.2.11
180414  6:39:20 InnoDB: Initializing buffer pool, size = 128.0M
180414  6:39:20 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
Which is strange as the only other mysqld process is the one running on my Raspberry Pi.
Anyway, i stopped the Pi and I am getting:

Code: Select all

/i-data/37ba0db8 # mysqld -u root -p
180414  6:57:32 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180414  6:57:32 [Note] mysqld (mysqld 5.5.58-MariaDB) starting as process 31984 ...
180414  6:57:32 InnoDB: The InnoDB memory heap is disabled
180414  6:57:32 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
180414  6:57:32 InnoDB: Compressed tables use zlib 1.2.11
180414  6:57:32 InnoDB: Initializing buffer pool, size = 128.0M
180414  6:57:32 InnoDB: Completed initialization of buffer pool
180414  6:57:32 InnoDB: highest supported file format is Barracuda.
180414  6:57:32  InnoDB: Waiting for the background threads to start
180414  6:57:33 Percona XtraDB (http://www.percona.com) 5.5.55-MariaDB-38.9 started; log sequence number 1597945
180414  6:57:33 [ERROR] mysqld: unknown option '-p'
180414  6:57:33 [ERROR] Aborting

180414  6:57:33  InnoDB: Starting shutdown...
180414  6:57:37  InnoDB: Shutdown completed; log sequence number 1597945
180414  6:57:38 [Note] mysqld: Shutdown complete

/i-data/37ba0db8 # mysqld -u root
180414  6:57:40 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180414  6:57:40 [Note] mysqld (mysqld 5.5.58-MariaDB) starting as process 32013 ...
180414  6:57:40 InnoDB: The InnoDB memory heap is disabled
180414  6:57:40 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
180414  6:57:40 InnoDB: Compressed tables use zlib 1.2.11
180414  6:57:40 InnoDB: Initializing buffer pool, size = 128.0M
180414  6:57:40 InnoDB: Completed initialization of buffer pool
180414  6:57:40 InnoDB: highest supported file format is Barracuda.
180414  6:57:40  InnoDB: Waiting for the background threads to start
180414  6:57:41 Percona XtraDB (http://www.percona.com) 5.5.55-MariaDB-38.9 started; log sequence number 1597945
180414  6:57:41 [Note] Server socket created on IP: '127.0.0.1'.
180414  6:57:41 [Note] Event Scheduler: Loaded 0 events
180414  6:57:41 [Note] mysqld: ready for connections.
Version: '5.5.58-MariaDB'  socket: '/opt/tmp/mysql.sock'  port: 3306  Source distribution
I will stop trying to install ownCloud/Nextcloud on NAS and do it exclusively on Raspberry.

Thank you Mijzelf.

Post Reply