MySQL on El Capitan

John Korchok jkorchok at gmail.com
Tue Jan 28 03:13:15 UTC 2020


Is it just me, or has the MySQL port turned into a horror show? I've been following the MySQL HowTo (https://trac.macports.org/wiki/howto/MySQL) to install mysql57-server under El Capitan. The problems start with Step2: Create a Database. BTW, this is a clean install of MacPorts on this disk.

The page recommends For MySQL 5.7: 
$ sudo /opt/local/lib/mysql57/bin/mysqld --initialize --user=_mysql

Running that yields:
2020-01-28T01:53:44.271666Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-01-28T01:53:44.275433Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2020-01-28T01:53:44.275495Z 0 [ERROR] Aborting

Huh? This is a new installation, I hadn't added any data.

No biggie, I figured. I'll just install mysql56-server, even though it's outdated. But at Step 2, I'm supposed to run
$ sudo -u _mysql mysql_install_db

and when I do, I get:

WARNING: Could not write to config file /opt/local/etc/mysql56/my-new.cnf: Permission denied
Installing MySQL system tables...2020-01-27 21:09:21 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-01-27 21:09:21 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2020-01-27 21:09:21 0 [Note] /opt/local/lib/mysql56/bin/mysqld (mysqld 5.6.45) starting as process 20621 ...
2020-01-27 21:09:22 20621 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-01-27 21:09:22 20621 [Note] InnoDB: The InnoDB memory heap is disabled
2020-01-27 21:09:22 20621 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-01-27 21:09:22 20621 [Note] InnoDB: Memory barrier is not used
2020-01-27 21:09:22 20621 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-01-27 21:09:22 20621 [Note] InnoDB: Not using CPU crc32 instructions
2020-01-27 21:09:22 20621 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-01-27 21:09:22 20621 [Note] InnoDB: Completed initialization of buffer pool
2020-01-27 21:09:22 20621 [Note] InnoDB: Highest supported file format is Barracuda.
2020-01-27 21:09:22 20621 [Note] InnoDB: 128 rollback segment(s) are active.
2020-01-27 21:09:22 20621 [Note] InnoDB: Waiting for purge to start
2020-01-27 21:09:22 20621 [Note] InnoDB: 5.6.45 started; log sequence number 1600607
2020-01-27 21:09:22 20621 [Note] Binlog end
2020-01-27 21:09:22 20621 [Note] InnoDB: FTS optimize thread exiting.
2020-01-27 21:09:22 20621 [Note] InnoDB: Starting shutdown...
2020-01-27 21:09:23 20621 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK
Filling help tables...2020-01-27 21:09:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-01-27 21:09:24 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2020-01-27 21:09:24 0 [Note] /opt/local/lib/mysql56/bin/mysqld (mysqld 5.6.45) starting as process 20624 ...
2020-01-27 21:09:24 20624 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-01-27 21:09:24 20624 [Note] InnoDB: The InnoDB memory heap is disabled
2020-01-27 21:09:24 20624 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-01-27 21:09:24 20624 [Note] InnoDB: Memory barrier is not used
2020-01-27 21:09:24 20624 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-01-27 21:09:24 20624 [Note] InnoDB: Not using CPU crc32 instructions
2020-01-27 21:09:24 20624 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-01-27 21:09:24 20624 [Note] InnoDB: Completed initialization of buffer pool
2020-01-27 21:09:24 20624 [Note] InnoDB: Highest supported file format is Barracuda.
2020-01-27 21:09:24 20624 [Note] InnoDB: 128 rollback segment(s) are active.
2020-01-27 21:09:24 20624 [Note] InnoDB: Waiting for purge to start
2020-01-27 21:09:24 20624 [Note] InnoDB: 5.6.45 started; log sequence number 1625987
2020-01-27 21:09:24 20624 [Note] Binlog end
2020-01-27 21:09:24 20624 [Note] InnoDB: FTS optimize thread exiting.
2020-01-27 21:09:24 20624 [Note] InnoDB: Starting shutdown...
2020-01-27 21:09:25 20624 [Note] InnoDB: Shutdown completed; log sequence number 1625997
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
  /opt/local/lib/mysql56/bin/mysqladmin -u root password 'new-password'
  /opt/local/lib/mysql56/bin/mysqladmin -u root -h VHost-4.local password 'new-password'
Alternatively you can run:
  /opt/local/lib/mysql56/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
  cd /opt/local ; /opt/local/lib/mysql56/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
  cd mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
  http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
WARNING: Could not copy config file template /opt/local/share/mysql56/support-files/my-default.cnf to
/opt/local/etc/mysql56/my-new.cnf, may not have access rights to do so.
You may want to copy the file manually, or create your own,
it will then be used by default by the server when you start it.

OK, so I have no .cnf file, and even if I could find one and copy it, MySQL wouldn't use it. I'm supposed to know where the "right place for my system" if for the support files. I plunge ahead, time to set the password.

/opt/local/lib/mysql56/bin/mysqladmin -u root password 'blahblahblah'
/opt/local/lib/mysql56/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql56/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/opt/local/var/run/mysql56/mysqld.sock' exists!

OK. I check. No, there is no mysqld.sock in /opt/local/var/run/mysql56/, only .turd_mysql56-server. Just for fun, I check the mysql57 folder right next door. Nope, no mysqld.sock file there, either. Well _that's_ weird. Fortunately, there's an alternative, /opt/local/lib/mysql56/bin/mysql_secure_installation! Result?

VHost-4:local operations$ /opt/local/lib/mysql56/bin/mysql_secure_installation
ERROR: can't create .my.cnf.20863: Permission denied at /opt/local/lib/mysql56/bin/mysql_secure_installation line 105.
Cleaning up...
Warning: Could not unlink .my.cnf.20863: No such file or directory
Warning: Could not unlink .mysql.20863: No such file or directory

In desperation, I tried installing mariadb-10.2-server. But /opt/local/var/run/mariadb-10.2/ was also missing mysqld.sock. And I can't guess what syntax to use to set it up, because the paths include both mariadb and mysql names, and I have no idea which goes where.

Any ideas?







More information about the macports-users mailing list