kristopher
Posts: 2
Joined: Tue Jan 27, 2015 9:57 pm

Recent MySQL Update Issues

Tue Jan 27, 2015 10:11 pm

Hello all,

I've been searching the interwebs for anyone running into a similar situation but haven't had any luck. On Saturday, I ran an apt-get update && apt-get upgrade and it came back with the following output:

Code: Select all

The following packages will be upgraded:
  libmysqlclient18 mysql-client mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
7 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
Need to get 7,481 kB of archives.
After this operation, 22.5 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-common all 5.5.41-0+wheezy1 [78.4 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libmysqlclient18 armhf 5.5.41-0+wheezy1 [621 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-server all 5.5.41-0+wheezy1 [76.7 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-server-5.5 armhf 5.5.41-0+wheezy1 [1,828 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-client all 5.5.41-0+wheezy1 [76.6 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-client-5.5 armhf 5.5.41-0+wheezy1 [1,463 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mysql-server-core-5.5 armhf 5.5.41-0+wheezy1 [3,338 kB]
Fetched 7,481 kB in 4s (1,836 kB/s)                
Preconfiguring packages ...
(Reading database ... 78729 files and directories currently installed.)
Preparing to replace mysql-common 5.5.40-0+wheezy1 (using .../mysql-common_5.5.41-0+wheezy1_all.deb) ...
Unpacking replacement mysql-common ...
Preparing to replace libmysqlclient18:armhf 5.5.40-0+wheezy1 (using .../libmysqlclient18_5.5.41-0+wheezy1_armhf.deb) ...
Unpacking replacement libmysqlclient18:armhf ...
Preparing to replace mysql-server 5.5.40-0+wheezy1 (using .../mysql-server_5.5.41-0+wheezy1_all.deb) ...
Unpacking replacement mysql-server ...
Setting up mysql-common (5.5.41-0+wheezy1) ...
(Reading database ... 78729 files and directories currently installed.)
Preparing to replace mysql-server-5.5 5.5.40-0+wheezy1 (using .../mysql-server-5.5_5.5.41-0+wheezy1_armhf.deb) ...
[ ok ] Stopping MySQL database server: mysqld.
[ ok ] Stopping MySQL database server: mysqld.
Unpacking replacement mysql-server-5.5 ...
Preparing to replace mysql-client 5.5.40-0+wheezy1 (using .../mysql-client_5.5.41-0+wheezy1_all.deb) ...
Unpacking replacement mysql-client ...
Preparing to replace mysql-client-5.5 5.5.40-0+wheezy1 (using .../mysql-client-5.5_5.5.41-0+wheezy1_armhf.deb) ...
Unpacking replacement mysql-client-5.5 ...
Preparing to replace mysql-server-core-5.5 5.5.40-0+wheezy1 (using .../mysql-server-core-5.5_5.5.41-0+wheezy1_armhf.deb) ...
Unpacking replacement mysql-server-core-5.5 ...
Processing triggers for man-db ...
Setting up libmysqlclient18:armhf (5.5.41-0+wheezy1) ...
Setting up mysql-client-5.5 (5.5.41-0+wheezy1) ...
Setting up mysql-server-core-5.5 (5.5.41-0+wheezy1) ...
Setting up mysql-server-5.5 (5.5.41-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Setting up mysql-client (5.5.41-0+wheezy1) ...
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I walked through the process of purging and reinstalling mysql-server, but I ultimately end up with the following result each time:

Code: Select all

Setting up mysql-server-5.5 (5.5.41-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
150127 12:15:48 [Note] Plugin 'FEDERATED' is disabled.
150127 12:15:48 InnoDB: The InnoDB memory heap is disabled
150127 12:15:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150127 12:15:48 InnoDB: Compressed tables use zlib 1.2.7
150127 12:15:48 InnoDB: Using Linux native AIO
150127 12:15:49 InnoDB: Initializing buffer pool, size = 128.0M
150127 12:15:49 InnoDB: Completed initialization of buffer pool
150127 12:15:49 InnoDB: highest supported file format is Barracuda.
150127 12:15:49  InnoDB: Waiting for the background threads to start
150127 12:15:50 InnoDB: 5.5.41 started; log sequence number 9491943
/usr/sbin/mysqld: File './mysql-bin.000020' not found (Errcode: 13)
150127 12:15:50 [ERROR] Failed to open log (file './mysql-bin.000020', errno 13)
150127 12:15:50 [ERROR] Could not open log file
150127 12:15:50 [ERROR] Can't init tc log
150127 12:15:50 [ERROR] Aborting

150127 12:15:50  InnoDB: Starting shutdown...
150127 12:15:51  InnoDB: Shutdown completed; log sequence number 9491943
150127 12:15:51 [Note] /usr/sbin/mysqld: Shutdown complete

[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I started researching "File './mysql-bin.000020' not found" specifically and found that the file does, in fact, exist, though it's owned by root instead of mysql. I end up running (as root) 'chown mysql:mysql /var/lib/mysql/mysql-bin.*' and I'm then able to start mysql to serve the webpage. However, configuration after the fact results in:

Code: Select all

/usr/sbin/dpkg-reconfigure: mysql-server is broken or not fully installed
and reinstalling results in:

Code: Select all

E: Internal Error, No file name for mysql-server:armhf
Has anyone seen anything like this before or have any thoughts on the culprit? Just wanted to check before nuking the install and rebuilding.

Thanks!

User avatar
DougieLawson
Posts: 42481
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Recent MySQL Update Issues

Tue Jan 27, 2015 11:13 pm

The directory where MySQL holds your data is defined by

Code: Select all

basedir          = /var/lib/mysql
datadir          = /var/lib/mysql
in /etc/mysql/my.cnf

Does that exist on your system, or have you invalidly updated your *.cnf files?
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

kristopher
Posts: 2
Joined: Tue Jan 27, 2015 9:57 pm

Re: Recent MySQL Update Issues

Wed Jan 28, 2015 12:04 am

Thanks for the reply!

So, I had initially copied one of the example .cnf files from /usr/share/doc/mysql-server-5.5/examples/ and tweaked a couple of the values. I hadn't realized that it didn't specify any of the basic info, including the dirs and user. Then again, it hadn't given me any problems over the last couple months.

Luckily, I had the vanilla copy of the my.cnf saved as my.cnf.bak. I restored it, restarted mysql, and was able to upgrade it without an issue. My guess would be that since a user wasn't specified, it was creating the new mysql-bin.0000xx files as root and then mysql wasn't able to open them. Either way, it's all sorted now.

Thanks for your help -- much appreciated!

Return to “Raspberry Pi OS”