Changes between Version 4 and Version 5 of howto/MySQL
- Timestamp:
- Dec 30, 2014, 5:36:33 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/MySQL
v4 v5 12 12 If you want to run a MySQL server on this computer, install MySQL like this: 13 13 {{{ 14 sudo port install mysql56-server14 $ sudo port install mysql56-server 15 15 }}} 16 16 … … 23 23 Does this make links in /opt/local/bin for /opt/local/lib/mysql56/bin/ files? 24 24 25 sudo port select mysql mysql5625 $ sudo port select mysql mysql56 26 26 27 27 generates the output: … … 34 34 Also, mysql56 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: 35 35 {{{ 36 sudo port select mysql mysql5636 $ sudo port select mysql mysql56 37 37 38 export PATH=$PATH:/opt/local/lib/mysql56/bin38 $ export PATH=$PATH:/opt/local/lib/mysql56/bin 39 39 }}} 40 40 Once you have done at least one of the two previous commands, set up the main database: 41 41 42 42 {{{ 43 sudo -u _mysql mysql_install_db44 sudo chown -R _mysql:_mysql /opt/local/var/db/mysql56/45 sudo chown -R _mysql:_mysql /opt/local/var/run/mysql56/46 sudo chown -R _mysql:_mysql /opt/local/var/log/mysql56/43 $ sudo -u _mysql mysql_install_db 44 $ sudo chown -R _mysql:_mysql /opt/local/var/db/mysql56/ 45 $ sudo chown -R _mysql:_mysql /opt/local/var/run/mysql56/ 46 $ sudo chown -R _mysql:_mysql /opt/local/var/log/mysql56/ 47 47 }}} 48 48 … … 50 50 Activate your MySQL server installation so that it autostarts when you boot your machine: 51 51 {{{ 52 sudo port load mysql56-server52 $ sudo port load mysql56-server 53 53 }}} 54 54 55 55 and then verify that it is running: 56 56 {{{ 57 ps -ax | grep mysql57 $ ps -ax | grep mysql 58 58 }}} 59 59 = Step 4: Set the MySQL password = 60 60 Set the MySQL `root` password (it should currently be empty, see also the security option below): 61 61 {{{ 62 /opt/local/lib/mysql56/bin/mysqladmin -u root -p password <new-password>62 $ /opt/local/lib/mysql56/bin/mysqladmin -u root -p password <new-password> 63 63 }}} 64 64 Note: This command line form of the command will generate: … … 66 66 Therefore it is recommended that you use the interactive form: 67 67 {{{ 68 /opt/local/lib/mysql56/bin/mysqladmin -u root -p password68 $ /opt/local/lib/mysql56/bin/mysqladmin -u root -p password 69 69 }}} 70 70 ''Enter password:'' <press return> \\ … … 77 77 Test everything by logging in to the server. 78 78 {{{ 79 mysql -u root -p79 $ mysql -u root -p 80 80 }}} 81 81 You will be prompted: … … 89 89 Once you are logged in, simply exit the session like this: 90 90 {{{ 91 mysql> exit ;91 $ mysql> exit ; 92 92 }}} 93 93 94 94 If desired, reboot your machine and then run: 95 95 {{{ 96 ps -ax | grep mysql96 $ ps -ax | grep mysql 97 97 }}} 98 98 again to verify that the daemon is again running. … … 148 148 === Start === 149 149 {{{ 150 sudo port load mysql-server56150 $ sudo port load mysql-server56 151 151 }}} 152 152 === Stop === 153 153 {{{ 154 sudo port unload mysql-server56154 $ sudo port unload mysql-server56 155 155 }}} 156 156