LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-15-2008, 08:01 PM   #1
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Rep: Reputation: 38
Want to setup mysql for Amarok


Using Slackware 12

I'm trying to set up mysql as the database for Amarok. I compiled Amarok with mysql enabled.
I'm using the web page at :
http://amarok.kde.org/wiki/MySQL_HowTo

I started out with the following command and got these results:
Code:
root@Slack:~# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

I think I have to start the daemon first, but don't know how to do that.
Can someone show me how to do this?
I looked at a few web pages, but am unsure.

Thanks.
 
Old 05-15-2008, 08:34 PM   #2
LordAnta
Member
 
Registered: Apr 2008
Location: Munich, Germany
Distribution: Slackware current
Posts: 128

Rep: Reputation: 18
in a konsole as root:

Code:
  mysql_install_db
  chown mysql:mysql /var/run/mysql
  chown -R mysql:mysql /var/lib/mysql
  mysqld_safe & // this starts the mysql server
Afterwards:

Code:
 mysql
to start playing with mysql
 
Old 05-15-2008, 10:39 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I would recommend downloading the manual for MySQL from their website. Pay particular attention to the chapter on security. MySQL by default will have a couple demo tables you may want to delete or secure. The root account needs a password as well.
http://dev.mysql.com/doc/

You should use the client like:
mysql -u root -h <host> -p

If after creating the initial tables, "mysql -u root" works (on the same machine) that means that you need to create a password for the root account.

I use mysql as the db backend for amarok. I cheated and used the gui utility "mysql-administrator" to add the amarok user and configure a password.

One thing that I noticed is that amarok.directories.dir has full paths. If you use MySQL as a back end, and use a share to store the music or podcasts, you may want to have the same path used regardless of the computer you are running Amarok on.
Code:
mysql> SELECT dir FROM directories
    -> WHERE  dir LIKE '%LQ%';
+------------------------------------------------+
| dir                                            |
+------------------------------------------------+
| ./mnt/hpmedia/podcasts/LQ Radio                |
| ./mnt/hpmedia/podcasts/LQ Radio » LQ Podcasts |
| ./mnt/hpmedia/podcasts/ZENcast/LQ Radio        |
+------------------------------------------------+
3 rows in set (0.01 sec)
My podcasts directory is in $HOME/podcasts on my desktop computer (hpmedia). On my laptop, they are accessed via an NFS share mounted on /mnt/hpmedia/podcasts. On the desktop, I created a symbolic link /mnt/hpmedia/podcasts -> /home/jschiwal/podcasts. That way the database entries will be correct regardless of which computer I am running amarok on.

You may also want to configure Amarok to only track new files only on one computer (the one with the actual library). Otherwise you may have the access times constantly being changed whenever another machine updates the collection triggering a rescanning on each machine.

Another thing to do is open up a port on the firewall for mysql. The default is
tcp port 3306. That will allow the other computers on the lan to use your server.


Good Luck!

Last edited by jschiwal; 05-15-2008 at 11:01 PM.
 
Old 05-15-2008, 11:08 PM   #4
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Code:
# chmod +x /etc/rc.d/rc.mysqld
# /etc/rc.d/rc.mysqld start
is the CORRECT way to do it in Slackware.

That guide basically explains everything you need to do to get it up and running (including creating a root password), so you should be fine after starting mysqld like above (it'll start automatically every time you boot you system that way). If you forget your root password (or if you set it up long in the past and forgot about it, like I did) there are ways to recover from that as well.

Last edited by T3slider; 05-15-2008 at 11:11 PM.
 
Old 05-17-2008, 05:14 PM   #5
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Original Poster
Rep: Reputation: 38
I got the database setup:
Quote:
LordAnta
in a konsole as root:
mysql_install_db
chown mysql:mysql /var/run/mysql
chown -R mysql:mysql /var/lib/mysql
mysqld_safe & // this starts the mysql server
I then followed the directions at:
http://amarok.kde.org/wiki/MySQL_HowTo
I created a root password for mysql
and a MYSQL database and user for amarok, both called amarok.

I've looked at MySql manual and man pages, and am unsure of what to do.

Amarok is not scanning the folders in my home directory.

I wanted to do a few other things:

Change the password for the user amarok. I'm not sure if I did that correctly:
root@Slack:~# mysqladmin -u amarok -h localhost password "new_password"
mysqladmin: Can't turn off logging; error: 'Access denied; you need the SUPER privilege for this operation'

I would also like to rename the user and database or remove them and make new ones.

I would appreciate help. I'm new to this and apparently don't understand it.

Last edited by JosephS; 05-18-2008 at 09:23 AM.
 
Old 05-18-2008, 08:35 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I'd recommend that you run "mysql-administrator" instead (as root). You can easily add/edit user info and rights.

Quote:
Originally Posted by MySQL reference manual
5.8.5. Assigning Account Passwords
Passwords may be assigned from the command line by using the mysqladmin command:
shell> mysqladmin -u user_name -h host_name password "newpwd"
The account for which this command resets the password is the one with a user table row that matches user_name in the User
column and the client host from which you connect in the Host column.
Another way to assign a password to an account is to issue a SET PASSWORD statement:
mysql> SET PASSWORD FOR 'jeffrey'@'%' = PASSWORD('biscuit');
Only users such as root that have update access to the mysql database can change the password for other users. If you are not
connected as an anonymous user, you can change your own password by omitting the FOR clause:
mysql> SET PASSWORD = PASSWORD('biscuit');
You could log into mysql as the user amarok and then change your amarok password, for example:
Code:
mysql -u jschiwal -h hpmedia -p amarok
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 138
Server version: 5.0.45 SUSE MySQL RPM

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set password = password('xxxxxxx');
Query OK, 0 rows affected (0.04 sec)
I performed this example using my own user instead of 'amarok'. (I didn't want to mess with my own amarok MySQL user for a demonstration.) If you use mysql-administrator, you will see that there may be more forms that may need to be granted such as: amarok@'localhost', amarok@'<hostname>', amarok@'196.168.%'. The @<part> may be different for a remote computer running amarok.

After changing the password for the amarok user, update the password setting in amarok or it won't be able to log in.

Quote:
Amarok is not scanning the folders in my home directory.
You need to configure the directories to scan. Configure Amarok -> Collection. Do you have more than one host machine running amarok? If so, then you want to export the directory as an nfs service so that another host can access the file as well. As I indicated previously, I created a link: /mnt/hpmedia/podcasts -> /home/jschiwal/podcasts on hmedia so that the pathname would be the same on all machines running amarok. On the host hpamd64, /mnt/hpmedia/podcasts is where the podcasts share (/home/hpmedia/podcasts on hpmedia decktop) is mounted.

There is also an option in Amarok to monitor for new files, "Watch Folders for Changes". Amarok will then receive inotify messages from the kernel and update the database for just that entry. I think you only want this set on one host, the one hosting the exported music/podcast directory.

Last edited by jschiwal; 05-20-2008 at 07:46 PM. Reason: added comment. Changed tag type.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
amarok with mysql on slackware zux Slackware 1 05-06-2008 03:43 PM
amarok with mysql erklaerbaer Slackware 2 07-26-2007 09:29 PM
amaroK & MySQL STARHARVEST Linux - Software 1 06-27-2007 01:20 AM
Can't get MySQL support in amaroK mwales Linux - Software 1 02-02-2006 12:49 PM
Amarok and Mysql..help! RoaCh Of DisCor Linux - Newbie 2 06-21-2005 08:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration