Web Mail


Single IP

Project Links
resume
about me
about server
user land
webmail

Photo Albums
bpfountz
lpfountz
twice DIGITAL

Web Pages
bpfountz
lpfountz

Reviews
3054CB
Netgate Q&A
5354AP1 Aries2

You are visiting...
The DigitalPimp


created by:
 Ben Pfountz
Untitled Document
Setting Up MySQL

FreeBSD 4.9-PRERELEASE

The Digitalpimp Collection

Ben Pfountz

March 31, 2004

 

NOTE: If you are using MYSQL 4.1.1 or higher, you much use the MySQLi interface in PHP, which is seperate from the MySQL interface.

 

Install the port...

 

cd /usr/ports/databases/mysql41-server

make WITH_OPENSSL=YES OVERWRITE_DB=YES BUILD_OPTIMIZED=YES install

make clean

 

MySQL will only be used locally, adjust startup script...

 

edit /usr/local/etc/rc.d/mysql-server.sh and add --bind-address=127.0.0.1 to mysql startup.

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

netstat | grep "3306"

tcp4 0 0 localhost.3306 *.* LISTEN

 

MySQL install requires some security setup...
(dont forget to change the [username] and [password] accordingly)

mysql

drop database test;
use mysql;
delete from db where Db='test';
delete from db where Db='test\_%';
update user set password = password('[password]') where user = 'root';

quit

mysqladmin reload

 

mysql -p

[enter your root password]

create database pictures;

insert into user (Host, User, Password, Select_priv, Insert_priv,
Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv,
Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv,
Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv,
Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, ssl_type,
ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates,
max_connections) values ('localhost','[username]',password('[password]'),
'Y','Y','Y','Y','N','N','N','N','N','N','N','N','Y','N','N','N','N',
'N','N','N','N','','','','',0,0,0);

insert into host (Host, Db, Select_priv, Insert_priv, Update_priv,
Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv,
Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv)
values ('localhost','pictures','Y','Y','Y','Y','N','N','N','N',
'Y','N','N','N');

insert into db (Host, Db, User, Select_priv, Insert_priv, Update_priv,
Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv,
Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv)
values ('localhost','pictures','[username]','Y','Y','Y','Y','Y',
'Y','N','N','Y','N','N','N');

mysqladmin reload

 

Note, mysql is a little tricky after first installation. You can run the mysql client without a password, and it will give you access to the database, but since you did not log in as root, you dont have permission to change any settings. You need to specify '-u root' when logging in, and '-p' if you have a password set.

 

If you have forgotten the root password, or never knew it in the first place:

# /usr/local/etc/rc.d/mysqld.sh stop
# mysqld_safe --skip-grant-tables &
# mysqladmin -u root flush-privileges password "[new_password]"
# /usr/local/etc/rc.d/mysqld.sh stop
# /usr/local/etc/rc.d/mysqld.sh start

Install Notes
a7v bios
os notes
os install
kernel cfg
ports update
vinum
soft updates
quotas
public pmsns
firewall
named
ppp
dhcpd
samba
apache+modssl
mod_php5
proftpd
qmail
blackhole
courier-imap
shared-folders
sqwebmail
skeleton
dependencies
nut
automount
net-snmpd
mrtg
system update
system config
formt floppy
wireless IPsec
bdes cdrw's
MySQL
Cert Auth
CPES AD 1
CPES AD 2
CPES Grp Plcy
AD1 <-> AD2
AD Reference