This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Sharing mySQL database on network - HELP!

Tags: None
(comma "," separated)
juan_kerr
Registered Member
Posts
4
Karma
0
Hello,

I may be a complete idiot here, but I'm having realy difficulty sharing/accessing my main Amarok mySQL database on my second PC.

I have a main PC/server in my house with all of my music on. This PC runs Ubuntu 6.10 and Amarok. I have followed instructions to set up mySQL and my collection has been constructed on this PC. It works well.

I am set up Amarok on my second PC, which is running Kubuntu 6.10. However, I cannot connect to the first PC and I cannot seem to find a decent 'How To'. I am obviously aware that I need to use the same database name and same user name and password.

My server PC is called 'mediapc' and its IP is 192.168.1.102
My second PC is called 'desktop' and its IP is 192.168.1.105

My database is called 'amarok' and the username is 'amarok'.

I have tried entering the PC name, IP address, path to databse etc etc and I always get an error message when loading Amarok on the second PC as it can't connect to the database.

I would be very grateful if somebody could give me some guidance and a short 'how to' please.

Thanks
User avatar
tante
Registered Member
Posts
47
Karma
0
Open a terminal on your second PC and try this:
Code: Select all
mysql -p -u amarok -h 192.168.1.102 amarok


That tries to connect directly to the mysql database, if that does not work it might have something to do with the mysql configuration.
A very common mistake is to forget to give the user (in your case "amarok") the privilege to connect from other computers. For that when setting up the password you have to assign the password to USERNAME@% (the @% means "from any computer", @192.168.1.105 would mean that connections are only allowed from that one IP (more in the docs at http://dev.mysql.com/doc/refman/5.0/en/ ... users.html).

I hope that helps.


"Governments can be useful to the governed only so long as inherent
tendencies toward tyranny are restrained."
Frank Herbert, 'God Emperor Of Dune'
juan_kerr
Registered Member
Posts
4
Karma
0
Many thanks. I'm at work just now so can't try this just yet. I suspect when I set it up (using the wiki guide) I may have only set 'amarok@'localhost' to GRANT. I'll need to change it to any users like you suggest.

So, assuming that's what I have done. I need change that on the PC with the database.

So, to connect from my second PC do I just put the first PCs name into 'hostname' of the Amarok configuration settings (along with my current database settings, name, username and password)? Or do I use the machines IP address? or a path?
juan_kerr
Registered Member
Posts
4
Karma
0
Ok, I have logged in as root user on mySQL on the main PC and changed the rights for 'amarok'@'%'.
That seemed to work, it told me it was ok.

I ran the command you suggested from my second PC but I just get this error:

ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.102' (111)


I don't know what I haven't done? Any suggestions?
User avatar
dangle_wtf
Moderator
Posts
1252
Karma
0
you might also need to check your actual mysql config (possibly located somewhere like /etc/mysql/my.cnf) and make sure you're allowing remote connections at all.

On gentoo (for example), mysql is bound to all interfaces by default - not sure about other distros.


"There are two theories to arguing with women. Neither one works."
.
If men could get pregnant, we'd learn the true meaning of "screaming nancyboy wuss"
juan_kerr
Registered Member
Posts
4
Karma
0
You were spot on. I found the file in the location you suggested and commented out the line binding to the local host 127.0.0.1

That fixed it, I now have access on my second machine.

Thanks for all of your help, much appreciated. Amarok is excellent.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]