Tracy Phillips

Archive for the ‘mysql’ tag

Install MySQL 5.x on FreeBSD

leave a comment

Our little project for today is setting up MySQL on FreeBSD. Installing MySQL via the FreeBSD ports sytem is a fairly painless process.

To get started login to your server with an SSH client and issue the following command.

[server][root][~]# portinstall mysql-server

You should be presented with different versions of MySQL to choose from. I chose to install the mysql50-server version. If you require a different version for some reason, then you will need to say “yes” to it instead.

Once everything gets compiled we need to setup a way to start MySQL when your server starts.

[server][root][~]# echo 'mysql_enable="YES"' >> /etc/rc.conf

Lets go ahead and start mysql so we can go about setting up the MySQL root password.

[server][root][~]# /usr/local/etc/rc.d/mysql-server.sh start

Everything should have started up ok for you at this point. Lets go ahead an login at the MySQL root user.

[server][root][~]# mysql -u root -p

You will be prompted for a password, hit enter since we have not setup the password yet. Enter the following and be sure to replace MyPassword with the password of your choosing.

SET PASSWORD FOR root@localhost=PASSWORD('MyPassword');

Thats all there is to it. Lets exit MySQL now and log back in to make sure everything worked before we continue.

exit

Now lets log back in with our new password. When you are prompted for a password this time, be sure to use the password that you set above.

[server][root][~]# mysql -u root -p

Hopefully everything worked out. If it didn't your in trouble.. well not really, but that how to is for another day :)

Now lets delete user accounts that do not have a username or any passwords. Type each of the 3 following commands (while you are logged into mysql as the root user) to delete insecure accounts and then type exit.

use mysql;
delete from user where user='';
delete from user where host='localhost.localdomain';

And that's a wrap :)

Rails Server Setup:

Part 1: New Server Setup
Part 2: Setup FreeBSD 6.x
Part 3: FreeBSD Usability
Part 4: Setup FreeBSD To Use Blowfish
Part 5: Install and Setup PostgreSQL
Part 6: Install Lighttpd on FreeBSD
Part 7: Install MySQL 5.x on FreeBSD
Part 8: Install Ruby On Rails with FreeBSD

Written by Tracy

December 5th, 2005 at 12:38 pm

Posted in FreeBSD

Tagged with ,

New Server Setup

leave a comment

I am going through the process of switching from a Linux server (CentOS to be exact) running DirectAdmin as the control panel to a FreeBSD server with no control panel for management. Since I do not have to build within the constraints of some other company’s control panel, I thought I would install the best of breed servers and applications.

The main components that I require to be installed are:

PostgreSQL
Lighttpd
Ruby On Rails
Subversion
Postfix
Dovecot
Dspam

I will most likely do some more tweaking but at the moment that is the standard I wish to build against. I know for a fact that I will do some more “tweaking” such as setting up DNS RBLS, SPF, and maybe even Yahoo Domain Keys along with some good old postfix filtering for spam (can you tell I hate spam).
The fist thing that I will get to (hopefully in the next post) will be setting up FreeBSD 6 and getting it ready to install applications onto.

Rails Server Setup:

Part 1: New Server Setup
Part 2: Setup FreeBSD 6.x
Part 3: FreeBSD Usability
Part 4: Setup FreeBSD To Use Blowfish
Part 5: Install and Setup PostgreSQL
Part 6: Install Lighttpd on FreeBSD
Part 7: Install MySQL 5.x on FreeBSD
Part 8: Install Ruby On Rails with FreeBSD

Written by Tracy

November 28th, 2005 at 4:41 pm