From Earlham Cluster Department

Jump to: navigation, search

Destructions for setting up MySQL on hopperprime


cd /usr/ports/databases/mysql50-server/

make; make install

Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)

the first time you start the MySQL server after an upgrade from an earlier version.

     This port has installed the following files, which may act as network
     servers and may therefore pose a remote security risk to the system.


     This port has installed the following startup scripts, which may cause
     these network services to be started at boot time.


More information can be found at

first time install you need configure the mysql database tables

Note: this must be done under the mysql user or use --user=mysql

/usr/local/bin/mysql_install_db --user=mysql

set the root password

mysqladmin -u root -h password passwdhere

test to make sure the password is set.

hopperprime# mysqlshow -u root

mysqlshow: Access denied for user 'root'@'localhost' (using password: NO)

hopperprime# mysqlshow -u root -p

Enter password:


also set the root @localhost password

hopperprime# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8

Server version: 5.0.41 FreeBSD port: mysql-server-5.0.41

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select host, user from mysql.user;

host user
127.0.01 root root
localhost root

3 rows in set (0.00 sec)

mysql> SET PASSWORD FOR 'root'@'' =


Query OK, 0 rows affected (0.00 sec)


also add mysql_enable="YES" to /etc/rc.conf

mysql is now installed

Also install p5-DBD-mysql

hopperprime# locate p5-DBD-mysql

cd /usr/ports/databases/p5-DBD-mysql

make; make install

Also install php5-mysql hopperprime# locate php5-mysql

cd /usr/ports/databases/php5-mysql

make; make install

this install adds the following line to /usr/local/etc/php/extensions.ini configuration file to automatically load the installed extension:

hopperprime# pkg_info | grep mysql

mysql-client-5.0.41 Multithreaded SQL database (client)

mysql-server-5.0.41 Multithreaded SQL database (server)

p5-DBD-mysql-4.003 MySQL driver for the Perl5 Database Interface (DBI)

php5-mysql-5.2.2 The mysql shared extension for php

Personal tools
this semester