Annotation of wikisrc/pkgsrc/how_to_install_a_mysql_server.mdwn, revision 1.7
1.6 gutterid 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]].
1.2 schmonz 2:
3: # pkg_add -v mysql-server
1.5 gutterid 4:
1.2 schmonz 5:
6: If you decide to install via pkgsrc, because of a newer version, just enter:
7:
1.5 gutterid 8: # cd /usr/pkgsrc/databases/mysql57-server/
1.2 schmonz 9: # make install clean
1.5 gutterid 10:
1.2 schmonz 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:
1.5 gutterid 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:
1.2 schmonz 24:
25: If you want to copy the rc.d scripts automatically with pkgsrc, you can use:
1.5 gutterid 26:
1.2 schmonz 27: PKG_RCD_SCRIPTS=YES
1.5 gutterid 28:
1.2 schmonz 29:
30: into mk.conf(5).
31:
1.5 gutterid 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:
1.2 schmonz 33:
34: # mkdir /var/mysql
35: # mysql_install_db
36: # chown -R mysql:mysql /var/mysql
1.7 ! gutterid 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.
1.2 schmonz 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