I am trying to set up a development environment on my new MacBookPro 14 inch M1 Pro. I am using MacPorts because that is what I have used for many years. Setting up apache and php have mostly just worked, with only a minimal amount of tweaks.
But setting up the database gives lots of different kinds of errors. So I am wondering if it could be a Monterey problem or an Apple Silicon problem.
I have tried mariadb-10.6, mariadb-10.5 (just to see if that would work), and even mysql8. They all give different errors, which might be related to permissions.
I was under the impression that the Macports installs should "just work". But there are error messages that should be helpful.
So I uninstalled all the databases and started over so I could capture the error messages. Here is what I get:
jas@himalaya2 ~ % sudo -u _mysql /opt/local/lib/mariadb-10.6/bin/mysql_install_db
Password:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
Installing MariaDB/MySQL system tables in '/opt/local/var/db/mariadb-10.6' ...
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
/opt/local/lib/mariadb-10.6/bin/mysql_install_db: line 525: 71810 Abort trap: 6 "$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
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
Installation of system tables failed! Examine the logs in
/opt/local/var/db/mariadb-10.6 for more information.
The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:
shell> /opt/local/lib/mariadb-10.6/bin/mysql_install_db --defaults-file=~/.my.cnf
You can also try to start the mysqld daemon with:
shell> /opt/local/lib/mariadb-10.6/bin/mariadbd --skip-grant-tables --general-log &
and use the command line tool /opt/local/lib/mariadb-10.6/bin/mariadb
to connect to the mysql database and look at the grant tables:
shell> /opt/local/lib/mariadb-10.6/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 /opt/local/var/db/mariadb-10.6 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
jas@himalaya2 ~ %
So you can see why I say there is a permissions issue. At this point, looks like some major failures. Looking at the logs as advised is no help because the only log files there are not text files:
jas@himalaya2 ~ % cd /opt/local/var/db/mariadb-10.6
jas@himalaya2 mariadb-10.6 % ls
aria_log.00000001 ib_logfile0 mysql
aria_log_control ibdata1
ddl_recovery.log ibtmp1
jas@himalaya2 mariadb-10.6 %
Also trying to start without the grant tables gives yet more errors that seem to be permissions errors.
And there are no other my.cnf files on the system, so that hint is no help either.
So why does the plain vanilla steps I have take lead to all these issues? Monterey?
ls -ld ~
show