MYSQL

From Earlham CS Department
Revision as of 17:36, 4 June 2007 by Marouf (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Destructions for setting up MySQL on hopperprime

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.

/usr/local/libexec/mysqld


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

/usr/local/etc/rc.d/mysql-server

More information can be found at http://www.mysql.com/

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 hopperprime.cluster.earlham.edu 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:

Database
information_schema
mysql
test

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
hopperprime.cluster.earlham.edu root
localhost root

3 rows in set (0.00 sec)

mysql> SET PASSWORD FOR 'root'@'hopperprime.cluster.earlham.edu' =

PASSWORD('passwordhere');

Query OK, 0 rows affected (0.00 sec)

mysql>quit

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:

extension=mysql.so


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