LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-09-2021, 08:59 AM   #1
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Rep: Reputation: Disabled
cant setup maria/mysqlDB on netbook


Hello folks,
sometimes i forget the fun of reading all the insults, attacks, critics, comments mocking, etc... of users on other users

Anyway, I am banging my head on a wall here, because for the last 2days i have been trying to setup maria/mysql DB on a netbook after i upgraded to slackware current.

I read this post which, i am not sure has the same issue but, no solution is given.

The peculiarity is that I did manage to setup mariaDb on my laptop and desktop in the past few months (although, i remember it was a painstaking job) but nothing seems to work for this netbook.

So, what i have done:
1) of course, follow the tutorials on slackware docs;
- outcome:
Code:
bash-5.1# mysql_install_db
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
2021-04-09 15:04:26 0 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2021-04-09 15:04:26 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2021-04-09 15:04:26 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-04-09 15:04:26 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-04-09 15:04:26 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-04-09 15:04:26 0 [ERROR] Aborting

Installation of system tables failed!  Examine the logs in
/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> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/libexec/mysqld --skip-grant-tables --general-log &

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

    shell> /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 /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

bash-5.1#
a- yes, i did try the suggestions on that msg with no avail
b- i tried to check the log in /var/lib/mysql and there is no actual txt format log; 4 files all appear in database encrypted form i.e. aria_log.000001, aria_log_control, ib_logfiles101 and ibdata1
c- it was exactly the same error msg executing mysql_install_db --user=mysql

At this point i knew that it was pointless to try further but i did it anyway

2) /etc/rc.d/rc.mysqld start
Code:
bash-5.1# /etc/rc.d/rc.mysqld start
bash-5.1# 210409 15:35:25 mysqld_safe Logging to '/var/lib/mysql/localhost.home.err'.
210409 15:35:26 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe_helper: Can't create/write to file '/var/lib/mysql/localhost.home.err' (Errcode: 13 "Permission denied")
(not sure what "Permission Denied" meant; I was superuser and it did create 4 log files so, I dont understand how it was 'denied' to create another)

3) then tried to run mysql_secure_installation anyway
Code:
bash-5.1# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
(no matter whether I left it blank or inputted 'mambo-jumbo')


4) i thought, ok let's give it what it wants, a password
Code:
bash-5.1# mysqladmin -u root password '*********'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
bash-5.1#
And then i remembered that I had the same issue with the missing (damn) mysql.sock file that wouldn't create on the desktop and laptop too.

I remember that i tried several tutorials before finding the one that worked 2mnths ago but can't remember how or where i did it and i can't find it again.

Any suggestions will be welcomed.
 
Old 04-09-2021, 09:46 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,169

Rep: Reputation: Disabled
when you have created the initial databases you haven't actually followed the tutorial you linked: those instructions say to create it with this command
Code:
mysql_install_db --user=mysql
while you just used
Code:
mysql_install_db
and that's the reason why you later have
Code:
/usr/bin/mysqld_safe_helper: Can't create/write to file '/var/lib/mysql/localhost.home.err' (Errcode: 13 "Permission denied")
because the directory and the files are owned by root and not the mysql user.

this is explicited in the tutorial you linked
Quote:
Create the needed database(s) and set their permissions properly
As root, run:
Code:
root@darkstar# mysql_install_db --user=mysql
The user specified by –user will own the database files, so it's important to set the right user here, otherwise MySQL won't be able to write to your databases. By default MySQL in Slackware runs as user “mysql”, so that is the safe choice.
just delete the directory and relaunch the correct command
Code:
rm -fR /var/lib/mysql
mysql_install_db --user=mysql

Last edited by ponce; 04-09-2021 at 10:34 AM.
 
2 members found this post helpful.
Old 04-09-2021, 10:09 AM   #3
walecha
Member
 
Registered: Jan 2010
Location: Malang, +62
Distribution: slackware
Posts: 96

Rep: Reputation: 18
Did you check the ownership, permission, and the content of /var/lib/mysql before running mysql_install_db?

/var/lib/mysql should be empty before running mysql_install_db and it should be owned by user mysql. Mine is like this:
Code:
 $ ls -ld /var/lib/mysql
drwxr-x--- 8 mysql mysql 4096 Apr  9 13:09 /var/lib/mysql
That's why the command is 'mysql_install_db --user=mysql'. It will create all mysql/mariadb database files and owned by mysql user.
 
Old 04-09-2021, 11:00 AM   #4
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
when you have created the initial databases you haven't actually followed the tutorial you linked: those instructions say to create it with this command
Code:
mysql_install_db --user=mysql
while you just used
Code:
mysql_install_db
and that's the reason why you later have
Code:
/usr/bin/mysqld_safe_helper: Can't create/write to file '/var/lib/mysql/localhost.home.err' (Errcode: 13 "Permission denied")
because the directory and the files are owned by root and not the mysql user.

this is explicited in the tutorial you linked


just delete the directory and relaunch the correct command
Code:
rm -fR /var/lib/mysql
mysql_install_db --user=mysql
hi Ponce,
thank you for your quick reply.
In point 'c' of the opening thread, i did specify this:
Quote:
c- it was exactly the same error msg executing mysql_install_db --user=mysql
Perhaps, what i forgot to mention is that YES i repeated the process several times, every time deleting the /var/lib/mysql and /var/run/mysql directories.

And below is the error msg for the 9th or 10th attempt:
Code:
bash-5.1# updatedb
bash-5.1# ls /var/lib/mysql
ls: cannot access '/var/lib/mysql': No such file or directory
bash-5.1# mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
210409 17:46:38 [ERROR] mysqld got signal 4 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see https://mariadb.com/kb/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 10.5.9-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=0
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 466474 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x0 thread_stack 0x49000
??:0(my_print_stacktrace)[0x125c6ae]
??:0(handle_fatal_signal)[0xbbf822]
addr2line: 'linux-gate.so.1': No such file
linux-gate.so.1(__kernel_sigreturn+0x0)[0xb7efb554]
??:0(my_dlerror)[0x1276f30]
??:0(wsrep_notify_status(wsrep::server_state::state, wsrep::view const*))[0xfcc21a]
??:0(Wsrep_server_service::log_dummy_write_set(wsrep::client_state&, wsrep::ws_meta const&))[0x7de1bf]
??:0(Wsrep_server_service::log_dummy_write_set(wsrep::client_state&, wsrep::ws_meta const&))[0x7df151]
??:0(wsrep_notify_status(wsrep::server_state::state, wsrep::view const*))[0xf7158c]
??:0(ha_initialize_handlerton(st_plugin_int*))[0xbc29bd]
??:0(sys_var_pluginvar::sys_var_pluginvar(sys_var_chain*, char const*, st_plugin_int*, st_mysql_sys_var*))[0x96446c]
??:0(plugin_init(int*, char**, int))[0x965b8a]
??:0(unireg_abort)[0x86101c]
??:0(mysqld_main(int, char**))[0x867665]
??:0(main)[0x8241e7]
??:0(__libc_start_main)[0xb757b889]
??:0(_start)[0x85a651]
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /var/lib/mysql
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             7803                 7803                 processes
Max open files            32186                32186                files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       7803                 7803                 signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us
Core pattern: core

/usr/bin/mysql_install_db: line 524: 14387 Illegal instruction     "$mysqld_bootstrap" $defaults $defaults_group_suffix "$mysqld_opt" --bootstrap $silent_startup "--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" "--plugin-dir=${plugindir}" $args --max_allowed_packet=8M --net_buffer_length=16K

Installation of system tables failed!  Examine the logs in
/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> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/libexec/mysqld --skip-grant-tables --general-log &

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

    shell> /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 /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

bash-5.1#
after this, a /var/lib/mysql directory was created again (with the same 4 log files as listed above) but, NO /var/run/mysql directory.

I am doing this still as root

p.s.: i just read this
Quote:
210409 17:46:38 [ERROR] mysqld got signal 4 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
any chances that upgrading from slackware 14.2 (where everything was working well) to current my hardware packed up?
or is it more likely that the package is corrupted?
that's as far as my tech logic queries goes so, any further tips will be appreciated.
 
Old 04-09-2021, 11:12 AM   #5
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by walecha View Post
Did you check the ownership, permission, and the content of /var/lib/mysql before running mysql_install_db?

/var/lib/mysql should be empty before running mysql_install_db and it should be owned by user mysql. Mine is like this:
Code:
 $ ls -ld /var/lib/mysql
drwxr-x--- 8 mysql mysql 4096 Apr  9 13:09 /var/lib/mysql
That's why the command is 'mysql_install_db --user=mysql'. It will create all mysql/mariadb database files and owned by mysql user.
I did not check i had a /var/lib/mysql directory before running mysql_isnatll_db. I have always done it this way and never checked that prior to installing the server.
However, after the 'mysql_install_db --user=mysql' attempt, i checked and
Quote:
ls -ld /var/lib/mysql
drwx--- 2mysql root 4096 Apr 9 17:46 /var/lib/mysql
edit: out of curiosity, i checked the '/var/lib/mysql' permission on my desktop and this is it
Code:
bash-5.1$ ls -ld /var/lib/mysql
drwx------ 6 mysql root 4096 Apr  2 22:01 /var/lib/mysql
bash-5.1$
and all works as expected

Last edited by however; 04-09-2021 at 11:17 AM.
 
Old 04-09-2021, 12:02 PM   #6
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,169

Rep: Reputation: Disabled
Quote:
c- it was exactly the same error msg executing mysql_install_db --user=mysql
if you re-read what you posted above it seems to me that you have two completely different errors when you don't specify as an argument of mysql_install_db "--user=mysql" and when you do (in posts #1 and #4, respectively).

in case you want to be sure that you haven't done a full upgrade and that is crippling your system you can try (substitute "slackware64" with just "slackware" if you are using slackware-current 32bit)
Code:
slackpkg update
slackpkg install slackware64
slackpkg upgrade-all
slackpkg clean-system
note that the last command will propose you to remove packages that were part of slackware 14.2 and that should be removed whe switching to current but it will propose also to remove every third-party package you have installed, so be sure to deselect the third-party stuff (just that, not any 14.2 packages) that you are interested in keeping.
also, before launching the above command, be sure to not having blacklisted anything as it will most probably interfere with the upgrade.

Last edited by ponce; 04-09-2021 at 12:13 PM.
 
Old 04-09-2021, 12:23 PM   #7
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
a possibility could be that you haven't done a full upgrade: to verify you have done a full upgrade you can do (substitute "slackware64" with just "slackware if you are using slackware-current 32bit)
Code:
slackpkg update
slackpkg install slackware64
slackpkg upgrade-all
slackpkg clean-system
note that the last command will propose you to remove packages that were part of slackware 14.2 and that should be removed whe switching to current but it will propose also to remove every third-party package you have installed, so be sure to deselect the third-party stuff (just that, not any 14.2 packages) that you are interested in keeping.
also, before launching the above command, be sure to not having blacklisted anything as it will most probably interfere with the upgrade.
thanks again!
it gets interesting now because i believe that my little netbook has 32bit hardware; I know that 64bit software won't work on it (already tried, by mistake, to install apache openoffice package from my desktop, to only realize after 6hrs that i was trying to install the 64bit; everything was fine when i downloaded the 32bit version. ignore this blubbering.

However, in the last 48hrs I have run 'slackpkg update && install-new && upgrade-all' twice and it has completed flawlessly.

I have found this bug report which seems to be identical to my problem and although the developers couldnt fix it, there were suggested two possible issues:
1) reinstall mysql/mariaDB as the pre-built package was defective (it seemed to have fixed the issue for at least the user who reported the bug)
2) InnoDB issues

Now, i have no idea how to fix or even discuss InnoDB code and errors but I could try to download a new MariaDB package and reinstall it

Last edited by however; 04-09-2021 at 12:43 PM.
 
Old 04-09-2021, 02:38 PM   #8
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
slackpkg install slackware64
slackpkg upgrade-all
slackpkg clean-system[/code]
No dice.
Reinstalled mariaDB and a package 'sc...something' tried again running mysql_install_db --user=mysql and had the same long error msg.

In defense of my 1st post ('mysql_install_db', which was outlined as incorrect and, 'mysql_install_db --user=mysql' being the correct 1st step to install mysql server with no actual mysql package installed), would it not make this tutorial erroneous and misleading?

On the other hand, this tutorial suggests at the beginning to install mysql package.

Before I go ahead and try this other option (installing mysql on a 32bit netbook), could i make things worse?
 
Old 04-09-2021, 03:50 PM   #9
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Original Poster
Rep: Reputation: Disabled
ok, i am starting to doubt the full system upgrade. Although, It is frustrating because 'slackpkg update && slackpkg install slackware && slackware upgrade-all' won't outline any errors and/or packages missing

Another anomaly just presented: sbopkg won't sync and won't populate the queueus directory.

I am looking for a 32bit slackware.iso download (15 or current). But i can only find the 64bit.

I am wandering, could it be that this little 7yrs old netbook is not capable of "keeping up" with the resource-heavy KDE demand?
 
Old 04-09-2021, 03:59 PM   #10
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,505

Rep: Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890Reputation: 7890
You're not the first to discover that running the latest MariaDb on the latest 32bit Slackware is causing issues.
MongoDB stopped supporting 32bit OS a while ago and I guess it's that time for MariaDB too. Developers are just no longer testing their code on 32bit architectures and as a consequence, incompatibilies are inevitable.

You are experiencing other issues however that are not related to MariaDB or a 32bit OS. So perhaps there's a fix still. I wonder (not 'wander') whether you have noticed the *.new files that get installed by the package? The old mysql and older mariadb configuration files may not be fully compatible with the latest version you've installed. Check what differences you need to copy over.
 
Old 04-09-2021, 04:26 PM   #11
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
You're not the first to discover that running the latest MariaDb on the latest 32bit Slackware is causing issues.
MongoDB stopped supporting 32bit OS a while ago and I guess it's that time for MariaDB too. Developers are just no longer testing their code on 32bit architectures and as a consequence, incompatibilies are inevitable.

You are experiencing other issues however that are not related to MariaDB or a 32bit OS. So perhaps there's a fix still. I wonder (not 'wander') whether you have noticed the *.new files that get installed by the package? The old mysql and older mariadb configuration files may not be fully compatible with the latest version you've installed. Check what differences you need to copy over.
thanks Alien Bob,
for the reply and spelling correction )

Would you mind explaining what the sentence in bold exactly means?
I have not installed any newer/older mysql (none at all, actually) and/or MariaDB. I only deleted the current MariaDB and 'slackpkg install slackware' picked it up and reinstalled.

The only *.new files found on the system are
Quote:
bash-5.1$ locate *.new
/etc/shadow.new
/etc/rc.d/rc.inet1.conf.new
/usr/info/dir.new
If the current MariaDB doesnt support 32bit hardware anymore, would an older MariaDB fix the issue? and/or, would it be better to remove the MariaDB package and install mysql?
 
Old 04-10-2021, 03:49 AM   #12
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,169

Rep: Reputation: Disabled
I was able to replicate this on an samsung nc10 atom netbook I found laying around: I have rebuilt a debug version of mariadb that, probably just for being a debug/unstripped version, doesn't seem to crash here.
if you want to try it updating your installed version, it's here: it's bigger, a bit slower but it should work also for you.
 
Old 04-10-2021, 05:17 PM   #13
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 224

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
I was able to replicate this on an samsung nc10 atom netbook I found laying around: I have rebuilt a debug version of mariadb that, probably just for being a debug/unstripped version, doesn't seem to crash here.
if you want to try it updating your installed version, it's here: it's bigger, a bit slower but it should work also for you.
A huge super thank you Ponce. Your tweak worked perfectly. (it's a shame that Maria DB doesnt support 32bit architecture anymore).
And thanks to the slackware developers for making slack greater every day
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Maria Winslow's LinuxWorld Blog: Open Source Java Application ... LXer Syndicated Linux News 0 12-09-2005 05:47 PM
LXer: Maria Winslow's LinuxWorld Blog: Open Source Java Application ... LXer Syndicated Linux News 0 12-09-2005 03:46 PM
problem installing mysqldb for python ssaigol Slackware 1 06-15-2005 02:45 PM
Help me (python and MySQLdb module) Dark Carnival Programming 2 04-22-2004 07:31 AM
updating existing data in mysqldb gmarais Programming 2 03-08-2004 11:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration