Author Topic: MySQL Server wont start..  (Read 2280 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
MySQL Server wont start..
« on: August 22, 2019, 02:18:16 PM »
cant start mysql..
as it is it has to run in mysqld_safe --skip-grant -tables

but that is not the correct way..

i have reset mysql_root pwd..

have had this happen a lot over the last couple of upgrades.

any sugestions?
Thanks.
X
--------------------------------------------------------------------------------------------------------------------------------------------------
Aug 22 08:45:23  mysqld[6582]: 2019-08-22  8:45:23 139907290274048 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
Aug 22 08:45:23  mysqld[6582]: 2019-08-22  8:45:23 139907290274048 [ERROR] Plugin 'InnoDB' init function returned error.
Aug 22 08:45:23  mysqld[6582]: 2019-08-22  8:45:23 139907290274048 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Aug 22 08:45:23  mysqld[6582]: 2019-08-22  8:45:23 139907290274048 [Note] Plugin 'FEEDBACK' is disabled.
Aug 22 08:45:23  mysqld[6582]: 2019-08-22  8:45:23 139907290274048 [ERROR] Unknown/unsupported storage engine: InnoDB
Aug 22 08:45:23  mysqld[6582]: 2019-08-22  8:45:23 139907290274048 [ERROR] Aborting
Aug 22 08:45:23  systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Aug 22 08:45:23  systemd[1]: Failed to start MariaDB 10.1.41 database server.
Aug 22 08:45:23  systemd[1]: Unit mariadb.service entered failed state.
Aug 22 08:45:23  systemd[1]: mariadb.service failed.

---------------------------------------------------------------------------------------------------------------------------------------------------

I have made a backup of ibdata1, ib_logfile0, and ib_logfile1..
tried restarting, still doesnt work..

also made sure proper ownerships mysql:mysql on entire /var/lib/mysql direcory.
permissions?  seem okay.

also, restored from a 'working' backup the entire directory..
same thing.

frustrating.
:/
Thanks.

Offline
**
Re: MySQL Server wont start..
« Reply #1 on: August 22, 2019, 04:40:07 PM »
and then, sometimes i get this:

--------------------------------------------------------------------------------------------------------------------------
Aug 22 11:08:46  mysqld[19854]: 2019-08-22 11:08:46 139681155508480 [ERROR] InnoDB: Can't open './ibdata1'


Aug 22 11:08:46  mysqld[19854]: 2019-08-22 11:08:46 139681155508480 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
Aug 22 11:08:46  mysqld[19854]: 2019-08-22 11:08:46 139681155508480 [ERROR] Plugin 'InnoDB' init function returned error.
Aug 22 11:08:46  mysqld[19854]: 2019-08-22 11:08:46 139681155508480 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Aug 22 11:08:46  mysqld[19854]: 2019-08-22 11:08:46 139681155508480 [Note] Plugin 'FEEDBACK' is disabled.
Aug 22 11:08:46  mysqld[19854]: 2019-08-22 11:08:46 139681155508480 [ERROR] Unknown/unsupported storage engine: InnoDB
Aug 22 11:08:46  systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Aug 22 11:08:46  systemd[1]: Failed to start MariaDB 10.1.41 database server.
Aug 22 11:08:46  systemd[1]: Unit mariadb.service entered failed state.
Aug 22 11:08:46  systemd[1]: mariadb.service failed.

Offline
*
Re: MySQL Server wont start..
« Reply #2 on: August 22, 2019, 06:32:14 PM »
So this happen when you upgraded?

Offline
**
Re: MySQL Server wont start..
« Reply #3 on: August 22, 2019, 08:08:37 PM »
can't say for sure, i dont want to point the error in the wrong direction, but it basically happend "overnight", it was fine one day, then without any changes.. (and if i remember correctly the first time, there was an update, but again, i cant say 'for sure' what the cuse of this is exactly,  it's happened twice now, most recently. it is, if not at an upgrade :/   its a server ran on my laptop, which basically sits in the corner, lid closed.  rarely have had to touch it.  actually,it had been running without error for a little over 300 Days (uptime).
since the update, i think it was .862?  (i posted somewhere else), ive had this error keeps reappearing. since the first time. :/



Offline
**
Re: MySQL Server wont start..
« Reply #4 on: August 22, 2019, 11:59:00 PM »
ok, i managed to get my cwp back together..
i will share with you what i can (and remember correctly):

i did this: (i made it into a script though) but you can do it line-by-line i guess.
Fix for MySQL “Unable to lock ibdata1” error

/etc/init.d/mysql stop
mv /var/lib/mysql/ibdata1 /var/lib/mysql/ibdata1.bak &
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak &
mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak &
cp -a /var/lib/mysql/ibdata1.bak /var/lib/mysql/ibdata1 &
cp -a /var/lib/mysql/ib_logfile0.bak /var/lib/mysql/ib_logfile0 &
cp -a /var/lib/mysql/ib_logfile1.bak /var/lib/mysql/ib_logfile1 &
/etc/init.d/mysql restart

more or less, its just "refreshing" the files, obviously.
weird thing is, i had done this very similar before, just not all at once.
but, its working now..

i also used this PRIOR to running the above commands:
resetting the mysql*root password: this one worked.
some reason, again?, some variants of these don't work. it seemed.
but this has:

https://support.rackspace.com/how-to/mysql-resetting-a-lost-mysql-root-password/

----------
Notes:
after running the above script/commands
it didnt seem to work straight away..

over the days time i would check it, and it wouldnt (on CWP Panel) restart.

i sat down now, and killed all mysql processes (killall mysql, and killall msqld)
some reason at times i would kill -9 process ID, etc, but it would still say
I had another process running mysqld, and *that* (i think) has been the problem all along.

maybe its reporting a false process/positive? i dont know, i had rebooted, started/stopped/disabled, the whole routine.
maybe a weird 'glitch' in killing/unloading the MYSQL process.. anyways, the above method has worked, for me at least.

Really hope it helps someone else too.
I'm keeping this in my "NOTES" on CWP for future reference.. LOL 
What a pain.

Cheers.
X