While messing around with some of my other sites I ran into a major problem. I had developed a great deal of conent for the main site and thought it would be great to make a seperate site for mobile users. The new site would of course be much smaller and compact but still allow the majority of data from the main site to be viewed.
When I started developing the mobile site hit a brick wall, I could not connect to the database on my main site even though both sites were on the same server. I tried connecting to localhost as well as the IP address, specifying the db name or calling it from the query. Needless to say it tooks hours to figure out what was going on so here is my solution.
Note: These sites are hosted on a MediaTemple DV server which is a virtualized dedicated server run through PLESK. Each domain hosted on the server gets assigned it’s own db.
Log into the SSH terminal and go to your mySQL prompt by using the following command line:
mysql –uadmin –p`cat /etc/psa/.psa.shadow`Your promt should now look like:
mysql>
Once you are in your mySQL prompt you can create a new user(which is what I did) or you can just modify an existing user.
To create a new user, replace your ip below, *** is the password:
CREATE USER 'username'@'255.255.255.255' IDENTIFIED BY '***';Next we need to give prvileges to this user:
GRANT SELECT ,INSERT ,UPDATE ,DELETE ,CREATE ,DROP ,FILE , INDEX ,ALTER, EXECUTE ON * . * TO 'username'@'255.255.255.255' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;And finally we need to grant privileges to all the databases on the server:
GRANT ALL PRIVILEGES ON * . * TO 'username'@'255.255.255.255';So now that the user is set up with all the correct privileges we can flush privileges and call this job done:
FLUSH PRIVILEGES;
Notes: Now I know this may not work for everyone and it is a rather generic setup but the above is meant to give you a starting point for opening up permissions accross a server. You will need to modify the above if you want only specific permissions given as well as access to only certain databases.
![[del.icio.us]](http://scriptperfect.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://scriptperfect.com/wp-content/plugins/bookmarkify/digg.png)
![[dzone]](http://scriptperfect.com/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://scriptperfect.com/wp-content/plugins/bookmarkify/facebook.png)
![[Furl]](http://scriptperfect.com/wp-content/plugins/bookmarkify/furl.png)
![[Google]](http://scriptperfect.com/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://scriptperfect.com/wp-content/plugins/bookmarkify/linkedin.png)
![[MySpace]](http://scriptperfect.com/wp-content/plugins/bookmarkify/myspace.png)
![[Newsvine]](http://scriptperfect.com/wp-content/plugins/bookmarkify/newsvine.png)
![[Propeller]](http://scriptperfect.com/wp-content/plugins/bookmarkify/propeller.png)
![[Reddit]](http://scriptperfect.com/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://scriptperfect.com/wp-content/plugins/bookmarkify/slashdot.png)
![[Spurl]](http://scriptperfect.com/wp-content/plugins/bookmarkify/spurl.png)
![[StumbleUpon]](http://scriptperfect.com/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://scriptperfect.com/wp-content/plugins/bookmarkify/technorati.png)
![[Twitter]](http://scriptperfect.com/wp-content/plugins/bookmarkify/twitter.png)
![[Email]](http://scriptperfect.com/wp-content/plugins/bookmarkify/email.png)
Hello…
I must point out my love for your kindness for men and women that absolutely need guidance on this particular topic. Your real dedication to getting the message around appeared to be pretty useful and has always encouraged girls much like me to reach t…
important links…
Guys check out these important links…
Blogs you should be reading…
[...]Here is a Great Blog You Might Find Interesting that we Encourage You[...]……
Cool blog…
[...]while the sites we link to below are completely unrelated to ours, we think they are worth a read, so have a look[...]…
Hello…
Thanks a lot for giving everyone an extremely wonderful opportunity to read in detail from this web site. It is always so great and stuffed with amusement for me and my office peers to visit your web site at least 3 times in one week to study the newes…
free website submisson…
I found this really informative post today…
………..
My spouse and i guess for the time being i’ll settle for bookmarking and also incorporating your current Rss to be able to our Google bank account. My spouse and i look forward to new updates and definately will share this kind of site using my person…
Superb website…
[...]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[...]……
Cool sites…
[...] Here are some of the sites that we recommend for our visitors [...]…
Gems from the Internet…
[...] I really like to look around the online world, routinely I will just go to Digg and read and look at stuff out [...]…
Links…
[...] just listed here, are a number of totally not related sites to ours, in spite of this, they are really worth talking about [...]…
Recommendations…
One spot which I can recommend for deeper details….
Websites to visit…
[...] even while sites we link below are notably not related to ours, we really feel they are really worth a go over, so have a peek [...]…
………..
We guess in the meantime i will be satisfied with book-marking and including your own RSS feed to my own Yahoo accounts. We look forward to fresh updates and can share this particular site along with my Facebook or myspace party….
Visitor recommendations…
[...] Just about every once in a while we go with blogs that we look over. Further down are the hottest sites that we choose [...]…
Not a chance……
[...] that is the end of this short article. Here you can find some sites that we believe you’ll appreciate, follow on the links through [...]…
a grill at mcdonald’s or being the…
chef in a high-society restaurant? while both are cooks, that is where any similarities end.somewhere along the way, most of us who seek out a career as a good writer imagine ourselves someday being a hemingway, edgar allan poe, or even…