Changes between Version 51 and Version 52 of howto/MAMP


Ignore:
Timestamp:
Apr 8, 2010, 8:01:57 PM (14 years ago)
Author:
dweber@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/MAMP

    v51 v52  
    162162}}}
    163163
    164 Set the MySQL `root` password (it’s currently empty):
     164Set the MySQL `root` password (it’s currently empty, see also the security option below):
    165165
    166166{{{
     
    189189
    190190again to verify that the daemon is again running.
     191
     192
     193==== Optional database upgrade ==== #mysql_upgrade
     194
     195If the database exists from a previous installation, you may need to upgrade.
     196
     197{{{
     198man mysql_upgrade
     199sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart
     200sudo /opt/local/lib/mysql5/bin/mysql_upgrade -u root -p
     201sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart
     202}}}
     203
     204
     205==== Optional security configuration ==== #mysql_security
     206
     207Place the following into {{{mysql_security.sql}}} and replace the {{{'MyNewPass'}}} with your root password.  Note that the SQL will remove all access for root from any location other than 'localhost'.  You might like to keep this SQL file - all the lines beginning with '--' are doc-comments about how to use it.
     208
     209{{{
     210-- HOW TO USE THIS FILE (with a MacPorts installation):
     211-- $ sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper stop
     212-- $ sudo mysqld_safe5 --init-file=mysql_security.sql &
     213-- The init will terminate if there are any errors in the init file.
     214-- Wait a bit to be sure the server is running.
     215-- If it's running, then shutdown the server (root password required):
     216-- $ /opt/local/bin/mysqladmin5 -u root -p shutdown
     217-- Check that everything worked.  There may be an ERROR if the test database
     218-- doesn't exist.  Otherwise there should be no errors in the file reported by
     219-- 'mysqld_safe Logging to ..." during the mysql_safe5 startup from above:
     220-- $ sudo tail -n 20 /opt/local/var/db/mysql5/*.err
     221
     222UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
     223DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';
     224DELETE FROM mysql.user WHERE User='';
     225FLUSH PRIVILEGES;
     226DROP DATABASE test;
     227DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
     228}}}
     229
     230See also http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix
     231
     232
    191233
    192234=== Step 4: Install PHP === #php