File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / how_to_install_a_mysql_server.mdwn
Revision 1.5: download - view: text, annotated - select for diffs
Sat Sep 4 21:07:52 2021 UTC (2 months, 3 weeks ago) by gutteridge
Branches: MAIN
CVS tags: HEAD
Reference MySQL 5.7, and fix various spelling and grammar issues

    1: Installing a MySQL server is easy. 
    2: 
    3: The fastest way is to install the binary package. This is only recommended if you wish to use your server as a standalone MySQL server, without any other server software like a web server. If you wish to use Apache and PHP, please read the article: [[How to install a LAMP Server]]. 
    4: 
    5: 
    6: It has the mysql-client as a dependency, which has to be installed first. 
    7:     
    8:     # pkg_add -v mysql-client
    9:     # pkg_add -v mysql-server
   10: 
   11: 
   12: If you decide to install via pkgsrc, because of a newer version, just enter: 
   13:     
   14:     # cd /usr/pkgsrc/databases/mysql57-server/
   15:     # make install clean
   16: 
   17: 
   18: It will automatically compile the client and the server. 
   19: 
   20: That's it... almost. Now copy the rc.d script into /etc/rc.d/: 
   21:     
   22:     # cp /usr/pkg/share/examples/rc.d/mysqld /etc/rc.d/
   23: 
   24: 
   25: 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"]]: 
   26: 
   27: 
   28:     # echo "mysqld=yes" >> /etc/rc.conf
   29: 
   30: 
   31: If you want to copy the rc.d scripts automatically with pkgsrc, you can use: 
   32: 
   33:     PKG_RCD_SCRIPTS=YES 
   34: 
   35: 
   36: into mk.conf(5). 
   37: 
   38: 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: 
   39:     
   40:     # mkdir /var/mysql
   41:     # mysql_install_db
   42:     # chown -R mysql:mysql /var/mysql
   43:     
   44: 
   45: If you need information about the MySQL server package, use the following: 
   46:     
   47:     # pkg_info mysql-server
   48:     
   49: 
   50: Have fun. 
   51: 
   52: ##  See also 
   53: 
   54:   * [[pkgsrc/How_to_install_a_LAMP_Server]]

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