Changes between Version 67 and Version 68 of howto/MAMP
- Timestamp:
- May 12, 2014, 10:56:44 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/MAMP
v67 v68 151 151 152 152 If 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 {{{ 154 sudo port install mysql51-server 155 }}} 156 mysql51-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 {{{ 158 sudo port select mysql mysql51 159 }}} 160 or: 161 {{{ 162 export PATH=$PATH:/opt/local/lib/mysql51/bin 163 }}} 164 Once you have done at least one of the two previous commands, you can then set up the main database like this: 160 165 {{{ 161 166 sudo -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 worktry this:''167 sudo chown -R mysql:mysql /opt/local/var/db/mysql51/ 168 sudo chown -R mysql:mysql /opt/local/var/run/mysql51/ 169 sudo chown -R mysql:mysql /opt/local/var/log/mysql51/ 170 }}} 171 172 ''If that fails to work, then try this:'' 168 173 {{{ 169 174 sudo 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 /175 sudo chown -R mysql:mysql /opt/local/var/db/mysql51/ 176 sudo chown -R mysql:mysql /opt/local/var/run/mysql51/ 172 177 }}} 173 178 174 179 Activate 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 {{{ 181 sudo port load mysql51-server 182 }}} 183 184 and then verify that it is running: 182 185 {{{ 183 186 ps -ax | grep mysql 184 187 }}} 185 188 186 Set the MySQL `root` password (it’s currently empty, see also the security option below): 187 189 Set the MySQL `root` password (it should currently be empty, see also the security option below): 188 190 {{{ 189 191 mysqladmin5 -u root -p password <new-password> 190 192 }}} 191 193 192 where `<new-password>` is your new desired root password. You will be prompted for your existing password ("`Enter password:`"); since it ’s empty, just press Return.194 where `<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. 193 195 194 196 Test everything by logging in to the server. 195 196 197 {{{ 197 198 mysql5 -u root -p 198 199 }}} 199 200 200 Once you’re logged in, simply exit the session 201 201 Once you are logged in, simply exit the session like this: 202 202 {{{ 203 203 mysql> exit ; 204 204 }}} 205 205 206 If desired, reboot your machine and then run 207 206 If desired, reboot your machine and then run: 208 207 {{{ 209 208 ps -ax | grep mysql 210 209 }}} 211 212 210 again to verify that the daemon is again running. 213 211 … … 223 221 sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart 224 222 }}} 223 (note: these instructions might not be applicable any longer...) 225 224 226 225