Changes between Version 4 and Version 5 of howto/MySQL


Ignore:
Timestamp:
Dec 30, 2014, 5:36:33 AM (9 years ago)
Author:
magill@…
Comment:

Add $ prefix to commands

Legend:

Unmodified
Added
Removed
Modified
  • howto/MySQL

    v4 v5  
    1212If you want to run a MySQL server on this computer, install MySQL like this:
    1313{{{
    14 sudo port install mysql56-server
     14$ sudo port install mysql56-server
    1515}}}
    1616
     
    2323Does this make links in /opt/local/bin for /opt/local/lib/mysql56/bin/ files?
    2424
    25 sudo port select mysql mysql56
     25$ sudo port select mysql mysql56
    2626
    2727generates the output:
     
    3434Also, 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:
    3535{{{
    36 sudo port select mysql mysql56
     36$ sudo port select mysql mysql56
    3737
    38 export PATH=$PATH:/opt/local/lib/mysql56/bin
     38$ export PATH=$PATH:/opt/local/lib/mysql56/bin
    3939}}}
    4040Once you have done at least one of the two previous commands, set up the main database:
    4141
    4242{{{
    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/
     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/
    4747}}}
    4848
     
    5050Activate your MySQL server installation so that it autostarts when you boot your machine:
    5151{{{
    52 sudo port load mysql56-server
     52$ sudo port load mysql56-server
    5353}}}
    5454
    5555and then verify that it is running:
    5656{{{
    57 ps -ax | grep mysql
     57$ ps -ax | grep mysql
    5858}}}
    5959= Step 4: Set the MySQL password =
    6060Set the MySQL `root` password (it should currently be empty, see also the security option below):
    6161{{{
    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>
    6363}}}
    6464Note: This command line form of the command will generate:
     
    6666Therefore it is recommended that you use the interactive form:
    6767{{{
    68 /opt/local/lib/mysql56/bin/mysqladmin -u root -p password
     68$ /opt/local/lib/mysql56/bin/mysqladmin -u root -p password
    6969}}}
    7070 ''Enter password:'' <press return> \\
     
    7777Test everything by logging in to the server.
    7878{{{
    79 mysql -u root -p
     79$ mysql -u root -p
    8080}}}
    8181You will be prompted:
     
    8989Once you are logged in, simply exit the session like this:
    9090{{{
    91 mysql> exit ;
     91$ mysql> exit ;
    9292}}}
    9393
    9494If desired, reboot your machine and then run:
    9595{{{
    96 ps -ax | grep mysql
     96$ ps -ax | grep mysql
    9797}}}
    9898again to verify that the daemon is again running.
     
    148148=== Start ===
    149149{{{
    150 sudo port load mysql-server56
     150$ sudo port load mysql-server56
    151151}}}
    152152=== Stop ===
    153153{{{
    154 sudo port unload mysql-server56
     154$ sudo port unload mysql-server56
    155155}}}
    156156