Changes between Version 67 and Version 68 of howto/MAMP


Ignore:
Timestamp:
May 12, 2014, 10:56:44 PM (11 years ago)
Author:
cooljeanius (Eric Gallager)
Comment:

start of rewrite for transition from mysql5 port to mysql51 port

Legend:

Unmodified
Added
Removed
Modified
  • howto/MAMP

    v67 v68  
    151151
    152152If you merely want to access a MySQL server running on another computer, skip to step 4. If you want to run a MySQL server on this computer, install MySQL like this:
    153 
    154 {{{
    155 sudo port install mysql5-server
    156 }}}
    157 
    158 Set up the main database
    159 
     153{{{
     154sudo port install mysql51-server
     155}}}
     156mysql51-server is used in this example because it is the closest to the port that was previously used in this example, which was mysql5-server. However, there are newer versions of mysql in MacPorts that may be worth considering instead. The only reason for not using any of these newer versions in this example is because that would probably require making even more changes than the move to mysql51 required. If you are personally moving from the mysql5 port to the mysql51 port, you may want to add the `+openssl` variant, as the openssl support that had previously been available by default in the mysql5 port has been moved to a variant in the mysql51 port. Even though the mysql51-server port does not have this variant itself, if you supply the variant with your invocation of `port`, it will still get passed down to the mysql51 port, because it will be installed as a dependency. Also, mysql51 now uses the `port select` mechanism, so you will have to run one of the following to get the mysql commands in your PATH: either:
     157{{{
     158sudo port select mysql mysql51
     159}}}
     160or:
     161{{{
     162export PATH=$PATH:/opt/local/lib/mysql51/bin
     163}}}
     164Once you have done at least one of the two previous commands, you can then set up the main database like this:
    160165{{{
    161166sudo -u mysql mysql_install_db5
    162 sudo chown -R mysql:mysql /opt/local/var/db/mysql5/
    163 sudo chown -R mysql:mysql /opt/local/var/run/mysql5/
    164 sudo chown -R mysql:mysql /opt/local/var/log/mysql5/
    165 }}}
    166 
    167   ''If that doesn’t work try this:''
     167sudo chown -R mysql:mysql /opt/local/var/db/mysql51/
     168sudo chown -R mysql:mysql /opt/local/var/run/mysql51/
     169sudo chown -R mysql:mysql /opt/local/var/log/mysql51/
     170}}}
     171
     172  ''If that fails to work, then try this:''
    168173  {{{
    169174sudo mysql_install_db5
    170 sudo chown -R mysql:mysql /opt/local/var/db/mysql5/
    171 sudo chown -R mysql:mysql /opt/local/var/run/mysql5/
     175sudo chown -R mysql:mysql /opt/local/var/db/mysql51/
     176sudo chown -R mysql:mysql /opt/local/var/run/mysql51/
    172177  }}}
    173178
    174179Activate your MySQL server installation so that it autostarts when you boot your machine:
    175 
    176 {{{
    177 sudo port load mysql5-server
    178 }}}
    179 
    180 and then verify that it’s running
    181 
     180{{{
     181sudo port load mysql51-server
     182}}}
     183
     184and then verify that it is running:
    182185{{{
    183186ps -ax | grep mysql
    184187}}}
    185188
    186 Set the MySQL `root` password (it’s currently empty, see also the security option below):
    187 
     189Set the MySQL `root` password (it should currently be empty, see also the security option below):
    188190{{{
    189191mysqladmin5 -u root -p password <new-password>
    190192}}}
    191193
    192 where `<new-password>` is your new desired root password. You will be prompted for your existing password ("`Enter password:`"); since its empty, just press Return.
     194where `<new-password>` is your new desired root password. You will be prompted for your existing password ("`Enter password:`"); since it is empty, just press Return.
    193195
    194196Test everything by logging in to the server.
    195 
    196197{{{
    197198mysql5 -u root -p
    198199}}}
    199200
    200 Once you’re logged in, simply exit the session
    201 
     201Once you are logged in, simply exit the session like this:
    202202{{{
    203203mysql> exit ;
    204204}}}
    205205
    206 If desired, reboot your machine and then run
    207 
     206If desired, reboot your machine and then run:
    208207{{{
    209208ps -ax | grep mysql
    210209}}}
    211 
    212210again to verify that the daemon is again running.
    213211
     
    223221sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart
    224222}}}
     223(note: these instructions might not be applicable any longer...)
    225224
    226225