File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / how_to_install_a_mysql_server.mdwn
Revision 1.6: download - view: text, annotated - select for diffs
Sun Sep 5 00:57:14 2021 UTC (12 months, 3 weeks ago) by gutteridge
Branches: MAIN
CVS tags: HEAD
Simplify basic installation instructions

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]]. 

    # pkg_add -v mysql-server

If you decide to install via pkgsrc, because of a newer version, just enter: 
    # cd /usr/pkgsrc/databases/mysql57-server/
    # make install clean

It will automatically compile the client and the server. 

That's it... almost. Now copy the rc.d script into /etc/rc.d/: 
    # cp /usr/pkg/share/examples/rc.d/mysqld /etc/rc.d/

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"]]: 

    # echo "mysqld=yes" >> /etc/rc.conf

If you want to copy the rc.d scripts automatically with pkgsrc, you can use: 


into mk.conf(5). 

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: 
    # mkdir /var/mysql
    # mysql_install_db
    # chown -R mysql:mysql /var/mysql

If you need information about the MySQL server package, use the following: 
    # pkg_info mysql-server

Have fun. 

##  See also 

  * [[pkgsrc/How_to_install_a_LAMP_Server]]

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb