View Single Post
  #1   (View Single Post)  
Old 23rd July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default Mysql 5.1 install on Freebsd 7 64 bit

This is not how I did it and solved the problems I had.

Installed it from ports:

Code:
cd /usr/ports/databases/mysql51-server/
make install clean

Install went fine but :
I could not start mysql server because the database could not be located and neither could I find the test and mysql databases which mysql installs . Also could not find the datadir it was not created. as i just ran make install clean and did not configure with the optional --datadir=<dbdir>. But still there should be a default datadir installed somewhere but despite my best efforts example : find / -name mysql -print to find it I could not. So i belive if you install mysql 5.1 from ports i.e 64 bit version than it does not create a default datadir unless you specify.

Usually the datadir is /var/db/mysql but I think nowadays it has changed to somewhere in /usr/local others can help out here.

Solutions:
Created a new directory in /var/db called mysql
To make the directory
cd /var/db
than
mkdir dirname
Or in webmin use the filemanager to create on.
Or if you use a ftp client do it there
http://www.computerhope.com/unix/umkdir.htm

Next give the new user and group "mysql" created during the install full control over the directory you created
Code:
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
Than create the sample database
cd to mysql basedir [ example /usr/local/bin ] that would be where a file called mysql_install_db exists

Run
Code:
mysql_install_db --user=mysql
this should create the default mysql databases usually called test and mysql. you can check to see if they are create by going to datadir.

Start mysql with command
Code:
(/usr/local/bin/safe_mysqld || /usr/local/bin/mysqld_safe) &
That got mysql 5.1 runing fine. If I get any errors after runing scripts I will post them here over the course of the next few weeks.
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5

Last edited by ijk; 23rd July 2008 at 11:36 AM.
Reply With Quote