HOW-TO synchronize your XBMC Media Center between every room in the house: Lifehacker

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #376
(2012-04-05 18:41)thothom Wrote:  I created xbmc user and assigned 192.168.1.3, I am running myqsl on my desktop and have xbmc on it too, I also have xbmc running on the media pc in the living room so what I gather is that the single xbmc user will be sufficient for both pc's?

yep. just make sure that the user can connect from both pc's, in your case one connection will be from localhost and the other from your media pc in the living room
find
thothom Offline
Junior Member
Posts: 17
Joined: Apr 2012
Reputation: 0
Post: #377
would I need to install mysql client on the media pc to check that?

| Windows 7 Professional x86_64 | Ubuntu 13.04 x86_64 |
| Gateway DX4710-UB301A | Intel Core2 Quad Q6700@2.66Ghz w/6 Gb's of ram |
| OCZ-Vertex3 120 Gb SSD | Western Digital 160 Gb HDD | Western Digital 640 Gb HDD |
| Nvidia GeForce GTX 550 Ti |
find
thothom Offline
Junior Member
Posts: 17
Joined: Apr 2012
Reputation: 0
Post: #378
(2012-04-05 17:57)noner Wrote:  
(2012-04-05 16:39)thothom Wrote:  Now I get this error:
Code:
Host 'thomthom.my modem.my gateway' is not allowed to connect to this MySQL server.

In your my.cnf ensure you have

skip-name-resolve

On the mysql command line enter

grant all on *.* to 'xbmc'@'%';

Assuming the user is 'xbmc'
(2012-04-05 16:14)thothom Wrote:  
Code:
If the user only has permission to connect from PC1, you cant use the same settings to connect from PC2

Could you elaborate on that a little further?

MySQL has the ability to limit access based on hostname, ip address etc. Each record in the mysql.user table corresponds to what user can connect from what network address.

The MySQL wildcard character is "%"

If there is only one record in mysql.user that says the host is 192.168.0.10 (for example) that means connections are accepted from just that one ip address. If it says 127.0.0.1 that means only connections from the actual host MySQL is running on (localhost) are accepted. If the record says 192.168.0.% that means any ip beginning with 192.168.0 can connect. If the host is set just to "%" then it can connect from anywhere

You can check this by issuing the following at the mysql command prompt

select user, host from mysql.user;

Makes sense?

Worked like a charm, thanks a million.Big Grin

| Windows 7 Professional x86_64 | Ubuntu 13.04 x86_64 |
| Gateway DX4710-UB301A | Intel Core2 Quad Q6700@2.66Ghz w/6 Gb's of ram |
| OCZ-Vertex3 120 Gb SSD | Western Digital 160 Gb HDD | Western Digital 640 Gb HDD |
| Nvidia GeForce GTX 550 Ti |
find
thothom Offline
Junior Member
Posts: 17
Joined: Apr 2012
Reputation: 0
Post: #379
I have another problem. When I pause a movie in my room to go watch in the living room it doesn't work. Do I need to create a user for connections from the media pc?

UDATE

I have it working, it's a little slow but it's working. Any way you know of to speed up the database?

My my.ini file.
Code:
innodb_thread_concurrency=9
skip-name-resolve
net_buffer_length = 16384
max_allowed_packet = 2097152
query_cache_type = 1
performance_schema_max_cond_classes = 80
performance_schema_max_cond_instances = 1000
performance_schema_max_rwlock_instances = 1000
performance_schema_events_waits_history_long_size = 10000
performance_schema_max_table_instances = 50000
performance_schema_max_rwlock_classes = 20
performance_schema_max_mutex_classes = 200
performance_schema_max_mutex_instances = 1000
query_cache_limit = 100M
performance_schema_max_table_handles = 100000
performance_schema_events_waits_history_size = 10
performance_schema_max_thread_classes = 50
performance_schema_max_file_handles = 32768
performance_schema_max_file_instances = 10000
query_cache_min_res_unit = 1M
performance_schema_max_file_classes = 50
performance_schema_max_thread_instances = 1000
max_user_connections = 0
table_definition_cache = 512
table_open_cache = 128

| Windows 7 Professional x86_64 | Ubuntu 13.04 x86_64 |
| Gateway DX4710-UB301A | Intel Core2 Quad Q6700@2.66Ghz w/6 Gb's of ram |
| OCZ-Vertex3 120 Gb SSD | Western Digital 160 Gb HDD | Western Digital 640 Gb HDD |
| Nvidia GeForce GTX 550 Ti |
(This post was last modified: 2012-04-06 00:43 by thothom.)
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #380
Where'd you get those settings from? They seem pretty off to me. A setting being in the file will override the default. My personal opinion (others here may disagree with me:

Remove the following form the file and let MySQL manage them based on defaults:

Code:
net_buffer_length = 16384
performance_schema_max_cond_classes = 80
performance_schema_max_cond_instances = 1000
performance_schema_max_rwlock_instances = 1000
performance_schema_events_waits_history_long_size = 10000
performance_schema_max_table_instances = 50000
performance_schema_max_rwlock_classes = 20
performance_schema_max_mutex_classes = 200
performance_schema_max_mutex_instances = 1000
performance_schema_max_table_handles = 100000
performance_schema_events_waits_history_size = 10
performance_schema_max_thread_classes = 50
performance_schema_max_file_handles = 32768
performance_schema_max_file_instances = 10000
performance_schema_max_file_classes = 50
performance_schema_max_thread_instances = 1000

Adjust the following:

Code:
query_cache_limit=2M
query_cache_size=128M
query_cache_min_res_unit = 1024

key_buffer_size = 24M
max_allowed_packet = 1M
table_open_cache        = 24576
sort_buffer_size = 2M
read_buffer_size        = 2M
read_rnd_buffer_size = 2M

innodb_buffer_pool_size = 128M

join_buffer_size = 2M

max_connections = 10
max_join_size = 4294967295

# Keep the 2 below the same:
tmp_table_size = 16M
max_heap_table_size     = 16M

See if that helps with performance
(This post was last modified: 2012-04-06 17:33 by noner.)
find
Finchy Offline
Senior Member
Posts: 168
Joined: Dec 2010
Reputation: 0
Post: #381
(2012-04-04 04:04)kri kri Wrote:  Did you guys follow the Mysql wiki? This lifehacker guide is out of date. If it doesn't work disable your firewalls and check again.

Yes, I followed the wiki guides. I tried it on WHS 2011 and my QNap NAS but neither would work. I disabled the firewall in WHS and it still didn't work. Confused
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #382
(2012-04-06 18:04)Finchy Wrote:  
(2012-04-04 04:04)kri kri Wrote:  Did you guys follow the Mysql wiki? This lifehacker guide is out of date. If it doesn't work disable your firewalls and check again.

Yes, I followed the wiki guides. I tried it on WHS 2011 and my QNap NAS but neither would work. I disabled the firewall in WHS and it still didn't work. Confused

At what specifically is it not working, if you could provide more information to the issue you are having then maybe someone would be able to point you in the right direction?

The MySQL setup works well and once you tune your setup, provided your MySQL install is running on capable hardware and your network is fast enough, performs just as well as having everything locally, there are just a few nuances you need to be aware of, permissions being one of them - and this is an area that the wiki does not touch on
find
Finchy Offline
Senior Member
Posts: 168
Joined: Dec 2010
Reputation: 0
Post: #383
Yes, I think permissions is one of the things I'm struggling with. I've tried loads of times now - uninstalling and reinstalling (removing all files in the process), tried the WPI version of MySQL, the latest 64 bit, tried using the standard installation (which doesn't open the firewall ports), customised installs.

I can usually connect locally and remotely using SQLyog and see the databases, but can't change user permissions in it, even when connected locally as root.

I had created a user for the WHS with folder access and the XBMC one for MySQL (as it feels a bit wrong having the same username and password for a Windows and SQL user and having the password as plain text in an XML file!) but the Windows XBMC user definately has file/folder permissions.
find
Finchy Offline
Senior Member
Posts: 168
Joined: Dec 2010
Reputation: 0
Post: #384
...for example, when I try

mysqlcheck -op -u xbmc xbmc_video

in the command prompt on the WHS with MySQL Server installed I get a 1045 error.
(This post was last modified: 2012-04-06 22:07 by Finchy.)
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #385
(2012-04-06 22:07)Finchy Wrote:  ...for example, when I try

mysqlcheck -op -u xbmc xbmc_video

in the command prompt on the WHS with MySQL Server installed I get a 1045 error.

mysqlcheck -uuser -ppassword --optimize xbmc_video

Try it without spaces between -u and user name, and no spaces between -p and password

From the MySQL man page

Quote:The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the
option and the password. If you omit the password value following the --password or -p option on the command line, mysqlcheck
prompts for one.

Specifying a password on the command line should be considered insecure. See Section 5.3.2.2, Ă¢End-User Guidelines for Password
Security

For other users struggling with permissions maybe an idea is to begin with granting all permissions both within MySQL as well as SMB for the folder access, and then one by one take permissions away, that way you can narrow down where you are running into an issue
(This post was last modified: 2012-04-07 00:03 by noner.)
find
PeterUK Offline
Junior Member
Posts: 28
Joined: Aug 2010
Reputation: 0
Post: #386
Hello lads, after a number of retrys and a lot of faffing around I've managed to get my WIndows and Openelec XBMC's syncing.

Hooray!

However I can sync my fanart etc for the main profile but not for my second one as I'm not sure what to replace the coding in advancedsettings wtih:

<from>special://masterprofile/Thumbnails/</from>

If I had a profile called Sofia should this just be changed to:

<from>profiles/sofia/Thumbnails/</from>

Thanks for any help Big Grin
find
Finchy Offline
Senior Member
Posts: 168
Joined: Dec 2010
Reputation: 0
Post: #387
OK, so thid is the process I have used;

Pre installation;

Network shares on WHS for the media folders set up, read/write access given to all relevant users and Homegroup users. Control checked by creating and deleting dummy files form another PC on the LAN.
Network share set up for XBMCthumbs with full read/write permissions.

MySQL installation;
Installed MySQL on WHS2011 via the Windows WPI installer (MySQL v 5.1)
Ran the config with standard installtion, set admin password, did not tick 'allow root access from remote machines'.
Added "skip-name-resolve" to the Mysqld section of the 'my.ini' file.
Changed the MySQL service to log on with the local administrator, stopped and restarted the service.
Added incoming and outgoing firewall access rules for port 3306 for domain and private connections.

MySQL XBMC setup;
Open up MySQL command line client and created the xbmc user and DB;
CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
CREATE database xbmc_video;
CREATE database xbmc_music;
GRANT ALL ON *.* TO 'xbmc';

At this point should I not be able to test the MySQL DB from another PC on the network for connection? I'm trying to connect with SQLyog and MySQL Workbench from my laptop using the IP and XBMC username/password but it's not connecting. I can however connect to it from SQLyog on the WHS as both root and XBMC, but when I check the user priveledges in there it doesn't have any for XBMC on the xbmc_video or xbmc_music databases, and if I try to add them it gives me a 1044 error.

Do I need to do anything else to the settings/priveledges in MySQL, and if so, how?

Also, for clarification, I have an ATV2 and a Windows 7 PC that I want to connect to the SQL server, although I'm looking at installing XBMCbuntu on the Win 7 PC. Do I need to open the firewall for the Win 7 client as well?
(This post was last modified: 2012-04-07 15:53 by Finchy.)
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #388
(2012-04-07 15:51)Finchy Wrote:  OK, so thid is the process I have used;

Pre installation;

Network shares on WHS for the media folders set up, read/write access given to all relevant users and Homegroup users. Control checked by creating and deleting dummy files form another PC on the LAN.
Network share set up for XBMCthumbs with full read/write permissions.

MySQL installation;
Installed MySQL on WHS2011 via the Windows WPI installer (MySQL v 5.1)
Ran the config with standard installtion, set admin password, did not tick 'allow root access from remote machines'.
Added "skip-name-resolve" to the Mysqld section of the 'my.ini' file.
Changed the MySQL service to log on with the local administrator, stopped and restarted the service.
Added incoming and outgoing firewall access rules for port 3306 for domain and private connections.

MySQL XBMC setup;
Open up MySQL command line client and created the xbmc user and DB;
CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
CREATE database xbmc_video;
CREATE database xbmc_music;
GRANT ALL ON *.* TO 'xbmc';

At this point should I not be able to test the MySQL DB from another PC on the network for connection? I'm trying to connect with SQLyog and MySQL Workbench from my laptop using the IP and XBMC username/password but it's not connecting. I can however connect to it from SQLyog on the WHS as both root and XBMC, but when I check the user priveledges in there it doesn't have any for XBMC on the xbmc_video or xbmc_music databases, and if I try to add them it gives me a 1044 error.

Do I need to do anything else to the settings/priveledges in MySQL, and if so, how?

Also, for clarification, I have an ATV2 and a Windows 7 PC that I want to connect to the SQL server, although I'm looking at installing XBMCbuntu on the Win 7 PC. Do I need to open the firewall for the Win 7 client as well?

Try running this as root:

grant all on *.* to 'xbmc'@'%' identified by 'yourpassword';
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #389
(2012-04-07 11:29)PeterUK Wrote:  Hello lads, after a number of retrys and a lot of faffing around I've managed to get my WIndows and Openelec XBMC's syncing.

Hooray!

However I can sync my fanart etc for the main profile but not for my second one as I'm not sure what to replace the coding in advancedsettings wtih:

<from>special://masterprofile/Thumbnails/</from>

If I had a profile called Sofia should this just be changed to:

<from>profiles/sofia/Thumbnails/</from>

Thanks for any help Big Grin

I would try

<from>special://Sofia/Thumbnails/</from>

But just FYI I have not done profiles so I could be wrong. Maybe someone with experience with profiles could guide you if the above does not work
find
Finchy Offline
Senior Member
Posts: 168
Joined: Dec 2010
Reputation: 0
Post: #390
(2012-04-07 19:58)noner Wrote:  Try running this as root:

grant all on *.* to 'xbmc'@'%' identified by 'yourpassword';

Ah, thanks. That has let me access it locally in SQLyog as root and allow priveledges for XBMC on xbmc_video and _audio. I still can't access remotely from my laptop though. Any ideas? SQLyog gets a "2003 error - cannot connect to MySQL server on 192.168.1.4 (10600)"
(This post was last modified: 2012-04-07 20:33 by Finchy.)
find
Thread Closed