problems upgrading mysql 5.6 => 5.7 (SOLVED)
freebsd at dreamchaser.org
Fri Mar 26 17:48:34 UTC 2021
On 3/22/21 5:42 PM, John R. Levine wrote:
>>> If you're using the mysql-server package, Mysql runs as the mysql
>>> user, user ID 88, and all of its data files should belong
>>> to mysql.
>>> Unless you really REALLY know what you are doing, nothing but mysql should be
>>> writing the files in its database directory so nobody else should have write access to it.
>> Well, I really *don't* know what I'm doing...
>> I always started mysqld from a user account. I didn't pay attention to the
>> owner/protections on the files, just set the data dir, and at one point I
>> changed the permissions of everything in that account to 600; I may have
>> forced the owner/group as well. I knew mysqld ran as mysql but I thought it
>> only did that when started by root.
> Assuming you have superuser access to your freebsd box, I think you will find that things work better when you run them the way they expect to be run. The mysql-server script expects to he run by root, usually at system startup, and then switch to the mysql user.
It turns out the problem had little to do with permissions or the account
used to start the server, and everything to do with mysql 5.7 default
/usr/local/etc/mysql/my.cnf for 5.7 specifies:
innodb_data_file_path = ibdata1:128M:autoextend
and the file in my datadir was smaller.
My ibdata1 file had size 27262976
1024 * 1024 = 1048576
27262976 / 1048576 = 26
I had to add the following to ~/.my.cnf:
The server then starts up fine from a normal user account using a data dir
with owner/group of user:user and file permissions of 600.
I found this in the following bug report:
More information about the freebsd-questions