44 pointsStarting to get into this DEV thingI'm helpful
drixie
Member
—
26th December 2011 (4 months ago)
There is a part of the multidb installation instructions that contains this:
"One final step is to make sure you have assigned a username and password to be associated with each database. This could be the same as your username and password for the original WordPress database. It's up to you, just make sure that there IS a username and password associated with each one and note what it is. You'll need this information for the next step."
I am using 256 databases. Am I supposed to set the username and password for each one? How can I set one username and password somewhere and use it for all databases (which would be a really time saving option)?
There is a part of the multidb installation instructions that contains this:
"One final step is to make sure you have assigned a username and password to be associated with each database. This could be the same as your username and password for the original WordPress database. It's up to you, just make sure that there IS a username and password associated with each one and note what it is. You'll need this information for the next step."
I am using 256 databases. Am I supposed to set the username and password for each one? How can I set one username and password somewhere and use it for all databases (which would be a really time saving option)?
I am using 256 databases. Am I supposed to set the username and password for each one? How can I set one username and password somewhere and use it for all databases (which would be a really time saving option)?
You can either have a single one for all databases or one per database - the former is probably the best approach.
My MySQL skills are not really strong. After creating this user, how do I grant the user permissions across 256 databases within having to use GRANT manually for each database?
Thank you for help
P.S. Is it not possible for some code that makes this easy to be included in the first code that creates the MySql databases?
It has the code in it to grant all permissions to all databases.
P.S. Is it not possible for some code that makes this easy to be included in the first code that creates the MySql databases?
No, because without the access rights to the new databases we can't run the code to grant access rights to the databases - so it's sort of a vicious circle and therefore requires a little bit of manual work.
Since this step of the process is inevitable, I think some form of guide on how to go about it should be included in the installation instructions, or the MySQL links above should be provided in the guide. The statement below makes it look like its a walk in the park:
One final step is to make sure you have assigned a username and password to be associated with each database. This could be the same as your username and password for the original WordPress database. It's up to you, just make sure that there IS a username and password associated with each one and note what it is. You'll need this information for the next step.
It would be nice if readers (especially beginners) know that part WILL require some form of further research or outside help. Why? Because when something is a guide, or some form of installation manual, you tend to believe that everything you need is provided in the text, which will also let you know if you need to consult an extra resource to get something done.
I spent one hour thinking I had done something wrong. The codes from the MySQL links are giving me some form of errors.. which means I cant do it properly. I have to contact my webhost to help me set up the permissions. I wish I knew that 2 hours ago.
7257 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Support Chimp
—
27th January 2012 (3 months ago)
#
Hey drixie.
Thanks for the feedback there, I'll be sure to pass it on for you :-)
We haven't heard from you on this thread for a while. So I'm going to presume your all fixed up now and don't need any further assistance. If do need anything else then just let us know. :-)
My overall goal:
Use WordPress Multisite to create 3,000,000 blogs from a CSV file using Batch Create and Multi-DB 4096 databases.
Finished:
• Created working version of WordPress multisite (path directory)
Issue (stuck for two days): “Cannot get multi-db to work”
1. Unzipped the multi-db pluggin and used FTP to upload to newly created mu-plugins folder under wp-content
2. Ran SQL create databases script on my server
3. Configured db-config file and used FTP to upload db-config and db file to wp-content folder
4. Configured move-blogs file and uploaded to newly created scripts folder under wp-content folder 5. Go to URL http://myinfopal.me/wp-content/scripts/move-blogs.php and get the following error “Could not connect to mysql”
Unzipped the multi-db pluggin and used FTP to upload to newly created mu-plugins folder under wp-content
Ok, this isn't a step in the installation instructions, so you'll need to delete everything you uploaded to the mu-plugins directory.
Could not connect to mysql
This suggests that the mysql connection settings are wrong in your move-blogs.php script, can you check the server, username and password are correct (these are usually the details you initially used when you set up WP) and that the user account has create permissions on all the databases you have created.
Here are the permissions on one of the new (4096) databases created, I noticed there is no wordpress_2 username.
Where did the wordpress_2 user come from?
I assume you have set the same user that you have used in wp-config.php with permissions across all your other databases, so you just need to transfer those settings into your move-blogs.php script and it should connect.
Ok, so it seems like that user has been created to access the database of the same name.
So, you have to decide if you want to use that user, then you will have to grant full permissions for that user to all your databases - otherwise you will have to use the admin user that you found before and use that for the user you want in your move-blogs and db-config files.
I changed the wp-config file from user wordpress_2 to admin, and got this error:
Error establishing a database connection
Which suggests that the user admin doesn't have rights to the wordpress_2 database. So as I wrote earlier - you are going to have to choose which user you want to use and assign full rights to all the databases for that user before you can go any further.
Have you added permissions for all the databases for the user you are going to use?
If so, then you add the details to move-blogs.php and run the transfer and it will create the tables in the relevant databases for you.
You then need to set up your db-config.php with the database details you generated with the db-tools ( http://premium.wpmudev.org/db-tools/db_servers.php ) and the username, password you used in move-blogs.php
Not sure what control panel you have (I think you mentioned plesk) or db admin facility you have, but you will need ssh or root mysql access to assign the permissions - I don't think you can do it via phpmyadmin.
I just used phpmyadmin and granted user wordpress_2 rights to the global table now I can actually see something and not a blank screen when I go to the move-blogs.php URL.
I used this SQL syntax:
GRANT ALL PRIVILEGES ON wordpress_2_global.* TO 'wordpress_2'@'localhost'
IDENTIFIED BY 'password_here'
Now, is there some simple SQL syntax to grant permissions for all 4096 tables?
As I wrote in my previous reply - I don't think you can grant it to all databases with phpmyadmin (in fact I'm pretty sure you can't) - you need ssh or root access to mysql and then you can use the wildcard database names (as per the documentation link I linked to before for the grant command) to assign rights to all databases.
Responses (33)
Developer — 26th December 2011 (4 months ago) #
You can either have a single one for all databases or one per database - the former is probably the best approach.
Here is a guide to the command and syntax you need to use to add the users quickly to your mysql system:
http://dev.mysql.com/doc/refman/5.1/en/create-user.html
Member — 26th December 2011 (4 months ago) #
Thank you for your prompt reply and the link.
My MySQL skills are not really strong. After creating this user, how do I grant the user permissions across 256 databases within having to use GRANT manually for each database?
Thank you for help
P.S. Is it not possible for some code that makes this easy to be included in the first code that creates the MySql databases?
Developer — 26th December 2011 (4 months ago) #
Have a read of this one:
http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
It has the code in it to grant all permissions to all databases.
No, because without the access rights to the new databases we can't run the code to grant access rights to the databases - so it's sort of a vicious circle and therefore requires a little bit of manual work.
Member — 26th December 2011 (4 months ago) #
This is just a feedback/opinion:
Since this step of the process is inevitable, I think some form of guide on how to go about it should be included in the installation instructions, or the MySQL links above should be provided in the guide. The statement below makes it look like its a walk in the park:
It would be nice if readers (especially beginners) know that part WILL require some form of further research or outside help. Why? Because when something is a guide, or some form of installation manual, you tend to believe that everything you need is provided in the text, which will also let you know if you need to consult an extra resource to get something done.
I spent one hour thinking I had done something wrong. The codes from the MySQL links are giving me some form of errors.. which means I cant do it properly. I have to contact my webhost to help me set up the permissions. I wish I knew that 2 hours ago.
Support Chimp — 27th January 2012 (3 months ago) #
Hey drixie.
Thanks for the feedback there, I'll be sure to pass it on for you :-)
We haven't heard from you on this thread for a while. So I'm going to presume your all fixed up now and don't need any further assistance. If do need anything else then just let us know. :-)
Take care.
Member — 10th February 2012 (3 months ago) #
Tim,
Are there updated instructions you can point me to?
I have been struggling with setting up muli-db for two days.
Developer — 10th February 2012 (3 months ago) #
@cartier247 - what problems have you been having?
Member — 10th February 2012 (3 months ago) #
Barry,
My overall goal:
Use WordPress Multisite to create 3,000,000 blogs from a CSV file using Batch Create and Multi-DB 4096 databases.
Finished:
• Created working version of WordPress multisite (path directory)
Issue (stuck for two days): “Cannot get multi-db to work”
1. Unzipped the multi-db pluggin and used FTP to upload to newly created mu-plugins folder under wp-content
2. Ran SQL create databases script on my server
3. Configured db-config file and used FTP to upload db-config and db file to wp-content folder
4. Configured move-blogs file and uploaded to newly created scripts folder under wp-content folder
5. Go to URL http://myinfopal.me/wp-content/scripts/move-blogs.php and get the following error “Could not connect to mysql”
Best Regards,
CJ
Developer — 10th February 2012 (3 months ago) #
Ok, this isn't a step in the installation instructions, so you'll need to delete everything you uploaded to the mu-plugins directory.
This suggests that the mysql connection settings are wrong in your move-blogs.php script, can you check the server, username and password are correct (these are usually the details you initially used when you set up WP) and that the user account has create permissions on all the databases you have created.
Member — 10th February 2012 (3 months ago) #
Here are the original WP database permissions:
I am using the admin username and passoword, but still get the error.
What about the username wordpress_2?
User Host Type Privileges Grant Action
admin localhost global ALL PRIVILEGES Yes Edit Privileges
wordpress_2 % database-specific ALL PRIVILEGES No Edit Privileges
Member — 10th February 2012 (3 months ago) #
Also, when I go to my original WP dashboard I get a blank screen with this error:
The website cannot display the page
Developer — 10th February 2012 (3 months ago) #
If you remove the db.php file from your wp-content directory, do you see the WP dashboard correctly again?
Member — 10th February 2012 (3 months ago) #
Ok, I see it now. I removed the dp.php file and the mu-pluggins content.
Here are the permissions on one of the new (4096) databases created, I noticed there is no wordpress_2 username.
User Host Type Privileges Grant Action
admin localhost global ALL PRIVILEGES Yes Edit Privileges
Developer — 10th February 2012 (3 months ago) #
Where did the wordpress_2 user come from?
I assume you have set the same user that you have used in wp-config.php with permissions across all your other databases, so you just need to transfer those settings into your move-blogs.php script and it should connect.
Member — 10th February 2012 (3 months ago) #
The wordpress_2 user came from when I installed WordPress for the first time using my Plesk Control panel.
Would the wordpress_2 password be the same as my admin password?
Would I set the wordpress_2 account in the db-config.php file?
Developer — 10th February 2012 (3 months ago) #
Not sure where wordpress_2 would come from, what user account is being used in your wp-config.php?
Member — 10th February 2012 (3 months ago) #
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress_2');
/** MySQL database username */
define('DB_USER', 'wordpress_2');
/** MySQL database password */
define('DB_PASSWORD', 'nBS6hc8V_5');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
define('WP_ALLOW_MULTISITE', true);
Developer — 10th February 2012 (3 months ago) #
Ok, so it seems like that user has been created to access the database of the same name.
So, you have to decide if you want to use that user, then you will have to grant full permissions for that user to all your databases - otherwise you will have to use the admin user that you found before and use that for the user you want in your move-blogs and db-config files.
Member — 10th February 2012 (3 months ago) #
I changed the wp-config file from user wordpress_2 to admin, and got this error:
Error establishing a database connection
Developer — 10th February 2012 (3 months ago) #
Which suggests that the user admin doesn't have rights to the wordpress_2 database. So as I wrote earlier - you are going to have to choose which user you want to use and assign full rights to all the databases for that user before you can go any further.
Member — 10th February 2012 (3 months ago) #
Note: I can logon to wp-admin interface for wordpress_2 using the admin ID with the wordpress_2 username configured in the wp-config file.
All of the 4096 new databases and wordpress_2 have admin will full rights.
User Host Type Privileges Grant Action
admin localhost global ALL PRIVILEGES Yes Edit Privileges
How do I make global changes to all 4096 databases if needed? (script)
Developer — 10th February 2012 (3 months ago) #
Scroll up :) http://premium.wpmudev.org/forums/topic/multi-db-plugin-unclear-installation-instruction#post-165174
Member — 10th February 2012 (3 months ago) #
How do you find the orginal password that Wordpress created with the install using Plesk?
For user wordpress_2 would it be the password I setup for admin?
Member — 10th February 2012 (3 months ago) #
I found the password for wordpress_2. I can now see the url for the move-blogs.php.
Member — 10th February 2012 (3 months ago) #
Is there anyway we can review this on a web session via GoToMeeting? I have an account.
I am kinda of in a hurry to implement this. thanks
Developer — 10th February 2012 (3 months ago) #
Have you added permissions for all the databases for the user you are going to use?
If so, then you add the details to move-blogs.php and run the transfer and it will create the tables in the relevant databases for you.
You then need to set up your db-config.php with the database details you generated with the db-tools ( http://premium.wpmudev.org/db-tools/db_servers.php ) and the username, password you used in move-blogs.php
There are more details on those steps in the installation notes here: http://premium.wpmudev.org/project/multi-db/installation/
Member — 10th February 2012 (3 months ago) #
I'm still reading thru the page you sent me on how to grant all the proper rights to user wordpress_2 to all 4096 databases.
Developer — 10th February 2012 (3 months ago) #
Not sure what control panel you have (I think you mentioned plesk) or db admin facility you have, but you will need ssh or root mysql access to assign the permissions - I don't think you can do it via phpmyadmin.
Member — 10th February 2012 (3 months ago) #
I just used phpmyadmin and granted user wordpress_2 rights to the global table now I can actually see something and not a blank screen when I go to the move-blogs.php URL.
I used this SQL syntax:
GRANT ALL PRIVILEGES ON wordpress_2_global.* TO 'wordpress_2'@'localhost'
IDENTIFIED BY 'password_here'
Now, is there some simple SQL syntax to grant permissions for all 4096 tables?
Developer — 10th February 2012 (3 months ago) #
As I wrote in my previous reply - I don't think you can grant it to all databases with phpmyadmin (in fact I'm pretty sure you can't) - you need ssh or root access to mysql and then you can use the wildcard database names (as per the documentation link I linked to before for the grant command) to assign rights to all databases.
Member — 10th February 2012 (3 months ago) #
It works now.
thanks for your help.
Member — 10th February 2012 (3 months ago) #
Do I know have to upload the multi-db folder to my pluggins folder on my site?
Developer — 10th February 2012 (3 months ago) #
No, the multi-db files don't touch the standard plugins directory.
From: http://premium.wpmudev.org/project/multi-db/installation/
Become a member