File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / how_to_install_a_mysql_server.mdwn
Revision 1.7: download - view: text, annotated - select for diffs
Sun Sep 12 20:42:59 2021 UTC (2 months, 2 weeks ago) by gutteridge
Branches: MAIN
CVS tags: HEAD
Add a note about the MySQL root password, as with the LAMP article

    1: Installing a MySQL server is easy. The fastest way is to install the binary package. If you wish to use Apache and PHP, please read the article [[How to install a LAMP Server]]. 
    2: 
    3:     # pkg_add -v mysql-server
    4: 
    5: 
    6: If you decide to install via pkgsrc, because of a newer version, just enter: 
    7:     
    8:     # cd /usr/pkgsrc/databases/mysql57-server/
    9:     # make install clean
   10: 
   11: 
   12: It will automatically compile the client and the server. 
   13: 
   14: That's it... almost. Now copy the rc.d script into /etc/rc.d/: 
   15:     
   16:     # cp /usr/pkg/share/examples/rc.d/mysqld /etc/rc.d/
   17: 
   18: 
   19: and start the MySQL server via NetBSD's [[!template id=man name="rc.d" section="8"]] framework. Only one modification is needed to [[!template id=man name="rc.conf" section="5"]]: 
   20: 
   21: 
   22:     # echo "mysqld=yes" >> /etc/rc.conf
   23: 
   24: 
   25: If you want to copy the rc.d scripts automatically with pkgsrc, you can use: 
   26: 
   27:     PKG_RCD_SCRIPTS=YES 
   28: 
   29: 
   30: into mk.conf(5). 
   31: 
   32: If MySQL is not starting up, you may need to create and set permissions on the /var/mysql directory and set up the default MySQL DB: 
   33:     
   34:     # mkdir /var/mysql
   35:     # mysql_install_db
   36:     # chown -R mysql:mysql /var/mysql
   37: 
   38: The default MySQL server database root password is auto-generated and marked expired upon creation. For security reasons, you should set your root password as soon as possible.
   39: 
   40: If you need information about the MySQL server package, use the following: 
   41:     
   42:     # pkg_info mysql-server
   43:     
   44: 
   45: Have fun. 
   46: 
   47: ##  See also 
   48: 
   49:   * [[pkgsrc/How_to_install_a_LAMP_Server]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb