Squeezebox Setup

MySQL installation and setup

MySQL comes bundled with Squeezecenter, so this step could be avoided. However enough other things on the box will end up using MySQL that there is no point in running two copies of it, so we will install it seperately, and use this version everywhere. First we need to install it – there are two parts – client and server. First the client:

[root@tranquilpc ~]# yum install mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.sov.uk.goscomb.net
* updates: mirror.sov.uk.goscomb.net
* addons: mirror.sov.uk.goscomb.net
* extras: mirror.sov.uk.goscomb.net
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mysql.i386 0:5.0.45-7.el5 set to be updated
--> Processing Dependency: perl(DBI) for package: mysql
--> Running transaction check
---> Package perl-DBI.i386 0:1.52-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================
Installing:
mysql i386 5.0.45-7.el5 base 4.1 M
Installing for dependencies:
perl-DBI i386 1.52-2.el5 base 600 k

Transaction Summary
=========================================================================================================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 4.7 M
Is this ok [y/N]:

When you say yes the client will be installed. Then the server:

[root@tranquilpc /]# yum install mysql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.sov.uk.goscomb.net
* updates: mirror.sov.uk.goscomb.net
* addons: mirror.sov.uk.goscomb.net
* extras: mirror.sov.uk.goscomb.net
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.i386 0:5.0.45-7.el5 set to be updated
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server
--> Running transaction check
---> Package perl-DBD-MySQL.i386 0:3.0007-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================
Installing:
mysql-server i386 5.0.45-7.el5 base 9.7 M
Installing for dependencies:
perl-DBD-MySQL i386 3.0007-2.el5 base 148 k

Transaction Summary
=========================================================================================================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 9.8 M
Is this ok [y/N]:

The server install has added a new mysql functional account (you can do cat /etc/passwd to prove it), so next we need to create a home area.

[root@tranquilpc etc]# cd /home
[root@tranquilpc home]# mkdir mysql
[root@tranquilpc home]# chown -R mysql:mysql mysql

Next we need to edit the mysql configuration to point it at the home area. The config is stored in /etc/my.cnf so edit that file and change the first 3 lines to:

[mysqld]
datadir=/home/mysql
socket=/var/lib/mysql/mysql.sock

Then we need to enable the service:

[root@tranquilpc etc]# chkconfig mysqld on

Turn the service on:

[root@tranquilpc etc]# service mysqld start
Initializing MySQL database: Installing MySQL system tables…
OK
Filling help tables…
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h tranquilpc password ‘new-password’
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[ OK ]
Starting MySQL: [ OK ]

Finally we need to set the root database password – change PASSWORDHERE to your password:

[root@tranquilpc etc]# /usr/bin/mysqladmin -u root password 'PASSWORDHERE'

[root@tranquilpc etc]# /usr/bin/mysqladmin -u root -h tranquilpc password 'PASSWORDHERE'

If the second one doesn’t work with this error:

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

It’s because the first command has set a password up for the root user on localhost. Instead run this command:

[root@tranquilpc etc]# /usr/bin/mysqladmin -u root -p -h tranquilpc password 'PASSWORDHERE'

Entering a password when prompted.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: