Termux-packages: Mariadb package is not install

Created on 25 Aug 2020  Â·  17Comments  Â·  Source: termux/termux-packages

Mariadb package has a bug.
After install 33% it shows me a error..
See it :

Initializing mysql data directory...
Installing MariaDB/MySQL system tables in '/data/data/com.termux/files/usr/var/lib/mysql' ...
Illegal instruction

Installation of system tables failed! Examine the logs in
/data/data/com.termux/files/usr/var/lib/mysql for more information.

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

shell> /data/data/com.termux/files/usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /data/data/com.termux/files/usr/bin/mysqld --skip-grant-tables --general-log &

and use the command line tool /data/data/com.termux/files/usr/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /data/data/com.termux/files/usr/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 /data/data/com.termux/files/usr/var/lib/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
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at https://mariadb.org/jira

My Android version is : 8.1.0
My termux version is up to date.

When I stared mysql server
mysqld_safe -u root &

200825 13:38:31 mysqld_safe Logging to '/data/data/com.termux/files/usr/var/lib/mysql/localhost.err'.
200825 13:38:32 mysqld_safe Starting mariadbd daemon with databases from /data/data/com.termux/files/usr/var/lib/mysql

In localhost.err file :
2020-08-25 11:15:20 0 [Note] InnoDB: Uses event mutexes
2020-08-25 11:15:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-08-25 11:15:20 0 [Note] InnoDB: Number of pools: 1
2020-08-25 11:15:20 0 [Note] InnoDB: Using generic crc32 instructions
2020-08-25 11:15:20 0 [Note] mariadbd: O_TMPFILE is not supported on /data/data/com.termux/files/usr/tmp (disabling future attempts)
2020-08-25 11:15:20 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2020-08-25 11:15:20 0 [Note] InnoDB: Completed initialization of buffer pool
2020-08-25 11:15:20 0 [Note] InnoDB: Header page consists of zero bytes in datafile: ./ibdata1, Space ID:0, Flags: 0
2020-08-25 11:15:20 0 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2020-08-25 11:15:20 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2020-08-25 11:15:20 0 [Note] InnoDB: Starting shutdown...
2020-08-25 11:15:20 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-08-25 11:15:20 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-08-25 11:15:20 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-08-25 11:15:20 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2020-08-25 11:15:20 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-08-25 11:15:20 0 [ERROR] Aborting

How I solve my problem ?

bug report

Most helpful comment

Alright, if that patch was causing this problem, guess it's needed.

All 17 comments

What is your output of termux-info?

mysqld_safe -u root &
mysql -u root -p
it gives me output:
MariaDB [MySQL]: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/data/com.termux/files/usr/tmp/mysqld.sock' (2)

Here is termux-info output
@Grimler91

$ termux-info
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://dl.bintray.com/termux/termux-packages-24/ stable main
# game-repo (sources.list.d/game.list)
deb https://dl.bintray.com/grimler/game-packages-24 games stable
# science-repo (sources.list.d/science.list)
deb https://dl.bintray.com/grimler/science-packages-24 science stable
Updatable packages:
All packages up to date
Android version:
8.1.0
Kernel build information:
Linux localhost 4.4.83+ #1 SMP PREEMPT Mon Jun 22 20:47:18 CST 2020 armv7l Android
Device manufacturer:
Symphony
Device model:
V98

Output of mysqld

2020-08-26 10:50:50 0 [Note] mysqld (mysqld 10.5.5-MariaDB) starting as process 6537 ...
2020-08-26 10:50:50 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32182)
2020-08-26 10:50:50 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
2020-08-26 10:50:50 0 [Note] InnoDB: Uses event mutexes
2020-08-26 10:50:50 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-08-26 10:50:50 0 [Note] InnoDB: Number of pools: 1
2020-08-26 10:50:50 0 [Note] InnoDB: Using generic crc32 instructions
2020-08-26 10:50:50 0 [Note] mysqld: O_TMPFILE is not supported on /data/data/com.termux/files/usr/tmp (disabling future attempts)
2020-08-26 10:50:50 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2020-08-26 10:50:50 0 [Note] InnoDB: Completed initialization of buffer pool
2020-08-26 10:50:50 0 [Note] InnoDB: Header page consists of zero bytes in datafile: ./ibdata1, Space ID:0, Flags: 0
2020-08-26 10:50:50 0 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2020-08-26 10:50:50 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2020-08-26 10:50:50 0 [Note] InnoDB: Starting shutdown...
2020-08-26 10:50:51 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-08-26 10:50:51 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-08-26 10:50:51 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-08-26 10:50:51 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2020-08-26 10:50:51 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-08-26 10:50:51 0 [ERROR] Aborting

/data/data/com.termux/files/usr/etc/init.d
./mysql start
Run
mysql



Or another way
cd '/data/data/com.termux/files/usr' ; /data/data/com.termux/files/usr/bin/mysqld_safe --datadir='/data/data/com.termux/files/usr/var/lib/mysql'
Open new session
mysql

Same problem... The previous package worked fine. Here's the termux-info:

$ termux-info
Packages CPU architecture:
arm
Subscribed repositories:

sources.list

deb https://dl.bintray.com/termux/termux-packages-24/ stable main

game-repo (sources.list.d/game.list)

deb https://dl.bintray.com/grimler/game-packages-24 games stable

science-repo (sources.list.d/science.list)

deb https://dl.bintray.com/grimler/science-packages-24 science stable
Updatable packages:
All packages up to date
Android version:
9
Kernel build information:
Linux localhost 3.18.120-perf+ #1 SMP PREEMPT Tue May 26 04:15:04 KST 2020 armv7l Android
Device manufacturer:
LGE
Device model:
LM-X220

@amm834 your given method not working.
cd '/data/data/com.termux/files/usr' ; /data/data/com.termux/files/usr/bin/mysqld_safe --datadir='/data/data/com.termux/files/usr/var/lib/mysql'

Output:
200830 00:30:04 mysqld_safe Logging to '/data/data/com.termux/files/usr/var/lib/mysql/localhost.err'.
200830 00:30:04 mysqld_safe Starting mariadbd daemon with databases from /data/data/com.termux/files/usr/var/lib/mysql

Then open new session.
mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/data/com.termux/files/usr/tmp/mysqld.sock' (2)

I find a issue when installation.
After 31 — 32 install
It gives
Installation of system tables failed! Examine the logs in
/data/data/com.termux/files/usr/var/lib/mysql for more information.

Maybe it will be fixed soon. I am waiting for this.
@waltspublic @Grimler91

@mmrtonmoybd From https://github.com/termux/termux-packages/issues/5738#issuecomment-680609852 I can see that your database is broken.

Uninstall mariadb and rm -rf /data/data/com.termux/files/usr/var/lib/mysql or move it somewhere. Then reinstall mariadb again.

@xeffyr same problem happen.
Now it gives this error after 16% install complete

Checking availability of current mirror: ok
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  mariadb
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/28.1 MB of archives.
After this operation, 385 MB of additional disk space will be used.
Selecting previously unselected package mariadb.
(Reading database ... 5695 files and directories currently installed.)
Preparing to unpack .../mariadb_2%3a10.5.5_arm.deb ...
Unpacking mariadb (2:10.5.5) ...
Setting up mariadb (2:10.5.5) ...
Initializing mysql data directory...
Installing MariaDB/MySQL system tables in '/data/data/com.termux/files/usr/var/lib/mysql' ...
Illegal instruction

Installation of system tables failed!  Examine the logs in
/data/data/com.termux/files/usr/var/lib/mysql for more information.

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

    shell> /data/data/com.termux/files/usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /data/data/com.termux/files/usr/bin/mysqld --skip-grant-tables --general-log &

and use the command line tool /data/data/com.termux/files/usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /data/data/com.termux/files/usr/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 /data/data/com.termux/files/usr/var/lib/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
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at https://mariadb.org/jira

@xeffyr For what it's worth (and I am by no means a package builder), I would assume the issue with mariadb 10.5.5 has something to do with -DGRN_WITH_LZ4=yes (LZ4 compression?). The mariadb 10.4.13 build.sh had this as -DGRN_WITH_LZ4=no, and, again, worked fine (as always) on my device. Anyway, this has probably already come to the Termux team's attention; however, I did make this untrained observation. At any rate, keep up the good work and thanks.

@mmrtonmoybd Thanks for trying to do a clean re-installation. That's a regression of old bug.

@buttaface What was the reason of deleting https://github.com/termux/termux-packages/commit/09989cc1e8756d793a898a3c116d9412f83b1ba5#diff-85a1bb31017d1cfb4ecae5f99e545884 ?


Fixed in https://github.com/termux/termux-packages/commit/75524ace814721b4f0a8ae837c01f587c60c38fc, updated package will be available soon unless build fail for some reason.

There was a conflict with MariaDB/server@c76b45a5 and I figured based on the comments there that using that builtin was only really ever disabled for clang AArch64, so our patch was no longer necessary. Should it just be disabled for all Android arches?

It fails on ARM.
Here is the original issue: https://github.com/termux/termux-packages/issues/4319

Alright, if that patch was causing this problem, guess it's needed.

@xeffyr @buttaface When will I get the latest update?
I need it hurry up.
Because I am making an open source laravel Ecommerce application and I am written all the code in my Android phone. And now this application needed to added mysql database.
https://github.com/mmrtonmoybd/laravel-ecommerce-application

It is available now on the main package mirror. Run pkg upgrade and see if it's fixed.

When will I get the latest update?

It is already available. pkg upgrade

However you need to rm or move the $PREFIX/var/lib/mysql before updating as DB is was corrupted again when you got illegal instruction error.

@xeffyr @buttaface Thank you to all.
solved.
now it is working.
Have a good day!
Happy coding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StephanBeer picture StephanBeer  Â·  3Comments

Cyb3rD3m0n picture Cyb3rD3m0n  Â·  3Comments

neitsab picture neitsab  Â·  3Comments

roalyr picture roalyr  Â·  3Comments

tigran123 picture tigran123  Â·  3Comments