[MacPorts] howto/MySQL modified

MacPorts Wiki noreply at macports.org
Thu Mar 26 13:17:55 UTC 2020


Page "howto/MySQL" was changed by haraldgroven
Diff URL: <https://trac.macports.org/wiki/howto/MySQL?action=diff&version=36>
Revision 36
Comment: MySQL8 is GA since 2019-04, please verify this with clean install
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: howto/MySQL
=========================================================================
--- howto/MySQL (version: 35)
+++ howto/MySQL (version: 36)
@@ -13,7 +13,8 @@
 MacPorts includes several versions of MySQL and some of its forks. You can install any or all of these versions simultaneously, though it is expected that you will only need to install one of them.
 
 * MySQL
-  * '''mysql57''': MySQL v5.7.x. This is the latest stable version of MySQL. Support ends Oct 2020.
+  * '''mysql8''': MySQL v8.x. This is the latest stable version of MySQL made General Available in 2019-04-19 
+  * '''mysql57''': MySQL v5.7.x. Support ends Oct 2020.
   * '''mysql56''': MySQL v5.6.x. Support ended Feb 2018
   * '''mysql55''': MySQL v5.5.x. Support ended Dec 2015.
   * '''mysql51''': MySQL v5.1.x. This version reached [https://www.mysql.com/support/eol-notice.html end of life] at the end of 2013 and is therefore no longer recommended.
@@ -36,14 +37,14 @@
 
 If you want to run a MySQL server on this computer, install MySQL like this:
 {{{
-$ sudo port install mysql57-server
+$ sudo port install mysql8-server
 }}}
 
 
 Select the installed version to be the default one
 
 {{{
-$ sudo port select mysql mysql57
+$ sudo port select mysql mysql8
 }}}
 
 
@@ -51,10 +52,10 @@
 == Step 2: Create a database ==
 
 
-**For MySQL 5.7:**
-
-{{{
-$ sudo /opt/local/lib/mysql57/bin/mysqld --initialize --user=_mysql
+**For MySQL 5.7 and newer**
+
+{{{
+$ sudo /opt/local/lib/mysql8/bin/mysqld --initialize --user=_mysql
 }}}
 
 Make a note of the root user password which is auto-generated.
@@ -70,16 +71,16 @@
 Set the owner:
 
 {{{
-$ sudo chown -R _mysql:_mysql /opt/local/var/db/mysql57/ 
-$ sudo chown -R _mysql:_mysql /opt/local/var/run/mysql57/ 
-$ sudo chown -R _mysql:_mysql /opt/local/var/log/mysql57/ 
+$ sudo chown -R _mysql:_mysql /opt/local/var/db/mysql8/ 
+$ sudo chown -R _mysql:_mysql /opt/local/var/run/mysql8/ 
+$ sudo chown -R _mysql:_mysql /opt/local/var/log/mysql8/ 
 }}}
 
 == Step 3: Start MySQL ==
 
 Activate your MySQL server so that it autostarts when you boot your machine:
 {{{
-$ sudo port load mysql57-server
+$ sudo port load mysql8-server
 }}}
 
 and then verify that it is running:
@@ -90,8 +91,8 @@
 If running, the command will return something like:
 
 {{{
-     /opt/local/bin/daemondo --label=mysql57-server --start-cmd /opt/local/lib/mysql57/bin/mysqld --user=_mysql ; --pid=exec
-     /opt/local/lib/mysql57/bin/mysqld --user=_mysql
+     /opt/local/bin/daemondo --label=mysql8-server --start-cmd /opt/local/lib/mysql8/bin/mysqld --user=_mysql ; --pid=exec
+     /opt/local/lib/mysql8/bin/mysqld --user=_mysql
      grep mysql
 }}}
 
@@ -100,7 +101,7 @@
 Set the MySQL `root` password (use the auto-generated password from the --initialize command above for MySQL 5.7. For MySQL 5.6 and earlier the password should currently be empty; see also the security option below):
 
 {{{
-$ /opt/local/lib/mysql57/bin/mysqladmin -u root -p password 
+$ /opt/local/lib/mysql8/bin/mysqladmin -u root -p password 
 }}}
 
  ''Enter password:'' <press return> \\
@@ -152,28 +153,28 @@
 
 {{{
 man mysql_upgrade  -- details on the upgrade program (man page)
-sudo port unload mysql57-server
-sudo /opt/local/lib/mysql57/bin/mysql_upgrade -u root -p
-sudo port load mysql57-server
+sudo port unload mysql8-server
+sudo /opt/local/lib/mysql8/bin/mysql_upgrade -u root -p
+sudo port load mysql8-server
 }}}
 
 == Configuration my.cnf ==
 
-/opt/local/etc/mysql57/my.cnf is a good place to customize your mysql57 installation.
-
-On activation if no /opt/local/etc/mysql57/my.cnf file exists one will be created which loads /opt/local/etc/mysql57/macports-default.cnf.
+/opt/local/etc/mysql8/my.cnf is a good place to customize your mysql8 installation.
+
+On activation if no /opt/local/etc/mysql8/my.cnf file exists one will be created which loads /opt/local/etc/mysql8/macports-default.cnf.
     
 
-Any changes made to /opt/local/etc/mysql57/macports-default.cnf will be lost during port upgrades, deactivations or activations. Currently /opt/local/etc/mysql57/macports-default.cnf contains only one directive; to disable networking. With disabled networking it is possible to install and have running all the MacPorts mysql ports simultaneously.
+Any changes made to /opt/local/etc/mysql8/macports-default.cnf will be lost during port upgrades, deactivations or activations. Currently /opt/local/etc/mysql8/macports-default.cnf contains only one directive; to disable networking. With disabled networking it is possible to install and have running all the MacPorts mysql ports simultaneously.
 
 == Starting and stopping the MySQL server ==
 === Start ===
 {{{ 
-$ sudo port load mysql57-server
+$ sudo port load mysql8-server
 }}}
 === Stop ===
 {{{ 
-$ sudo port unload mysql57-server
+$ sudo port unload mysql8-server
 }}}
 
 = Troubleshooting =
@@ -196,7 +197,7 @@
 }}}
 e.g.
 {{{
-phobos:org.macports.mysql57-server wf$ls -l /opt/local/var/db/mysql57
+phobos:org.macports.mysql8-server wf$ls -l /opt/local/var/db/mysql8
 total 221200
 -rw-r-----  1 _mysql  _mysql        56 31 Mär 09:17 auto.cnf
 -rw-r-----  1 _mysql  _mysql       273  8 Apr 08:51 ib_buffer_pool
@@ -208,14 +209,14 @@
 
 == initialize fails ==
 {{{
-sudo -u mysql /opt/local/lib/mysql57/bin/mysqld --initialize --user=_mysql
+sudo -u mysql /opt/local/lib/mysql8/bin/mysqld --initialize --user=_mysql
 2018-04-08T06:52:45.557302Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
 2018-04-08T06:52:45.557337Z 0 [ERROR] Aborting
 }}}
 You might want to backup the content of your data directory or if you absolutely sure remove it's content 
 e.g.
 {{{
-rm /opt/local/var/db/mysql57/*
+rm /opt/local/var/db/mysql8/*
 }}}
 and then rerun the mysqld initialize command.
 
@@ -233,8 +234,8 @@
 will show an increasing process number and the mysqld process will only show up every once in a while.
 {{{
 grep mysql /var/log/system.log
-Apr  8 08:26:11 phobos com.apple.xpc.launchd[1] (org.macports.mysql57-server[2262]): Service exited with abnormal code: 1
-Apr  8 08:26:11 phobos com.apple.xpc.launchd[1] (org.macports.mysql57-server): Service only ran for 2 seconds. Pushing respawn out by 8 seconds.
+Apr  8 08:26:11 phobos com.apple.xpc.launchd[1] (org.macports.mysql8-server[2262]): Service exited with abnormal code: 1
+Apr  8 08:26:11 phobos com.apple.xpc.launchd[1] (org.macports.mysql8-server): Service only ran for 2 seconds. Pushing respawn out by 8 seconds.
 }}}
 The following stackoverflow question has an answer that shows how you can modify the corresponding plist to give you the stderr output of the mysql server daemon:
 * https://apple.stackexchange.com/questions/231264/mysql-fails-to-load-on-boot
@@ -249,9 +250,9 @@
 then trying to run upgrade might give you:
 
 {{{
-sudo /opt/local/lib/mysql57/bin/mysql_upgrade -u root -p
+sudo /opt/local/lib/mysql8/bin/mysql_upgrade -u root -p
 Enter password: 
-mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql57/mysqld.sock' (2) while connecting to the MySQL server
+mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql8/mysqld.sock' (2) while connecting to the MySQL server
 Upgrade process encountered error and will not continue.
 }}}
 
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/howto/MySQL>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'howto/MySQL' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list