Here are the Steps:
STEP 01 : Put code in a Text File
Open up a text editor (vi, nano, emacs) and place your code in it.
Save it as /tmp/mynewcode.sql
STEP 02 : Collect All Databases Names
MYSQLCONN=`-uroot -ppassword`
SQLSTMT="SELECT schema_name FROM information_schema.schemata"
SQLSTMT="${SQLSTMT} WHERE schema_name NOT IN"
SQLSTMT="${SQLSTMT} ('information_schema','performance_schema','mysql')"
mysql ${MYSQLCONN} -ANe"${SQLSTMT}" > /tmp/dbnames.txt
STEP 03 : Load Stored Procedure into every database mentioned in /tmp/dbnames.txt
for DB in `cat /tmp/dbnames.txt` ; do mysql ${MYSQLCONN} -D${DB} < /tmp/mynewcode.sql ; done
STEP 04 : Remove the files you made (OPTIONAL)
rm -f /tmp/dbnames.txt
rm -f /tmp/mynewcode.sql
That’s it.
Give it a Try !!!
Related Posts:
- How To Add Custom Form Fields To The User Profile Page?
- Specific upload folder for PDFs in custom Post type in WP multisite
- How to delete post revisions?
- Add additional Network constants to wp-config.php dynamically
- Anyone figured out how to use WordPress MultiSite with Domain Mapping & SSL?
- Can upload doc and pdf but not ppt – not permitted for security reasons
- How do I transition multiple installations to a single Multisite installation?
- What is the best way to load the WP environment in a subdomain of my multisite WordPress install?
- Best way to develop multisite and deploy on another server?
- find a random blogid across my multisite network that has at least one post published
- How To Provide Sub-Blogs Their Own Domain Names?
- Removing My Sites menu from Admin
- Built to scale, or worry later?
- Prevent Deletion of Blogs
- NGINX Multisite Rewrite rules
- How to Set up a Multisite WordPress?
- Multisite, turn off “create new site”
- wp-admin slow in multisite
- Multiple Domains and Subdomains Using Multisite Installation
- restore_current_blog() vs. multiple switch_to_blog() followed by removing $GLOBALS[‘_wp_switched_stack’]
- SQL Query to Get list of all users along with their blogs
- What are the differences in capabilities between the super-administrator and administrator?
- Network setup tab is not shown under Tools
- How to move theme directory but not plugins/uploads out of WordPress root directory?
- How To Modify New Sub Blog Immediately When Super Administrator Creates It?
- How do I add JavaScript that will execute on all my sites in Multisite?
- How to prevent first post and first comment on WP MU?
- Subdomain and subdirectories together in one installation
- Using $wpdb Class to Pull Recent Comments Across a Network
- Limit multisite/network site names to a property of the user
- How do I maintain static directories on multisite subdomains?
- Split a database will improve performance?
- Why are images not displaying?
- Replacing the default content created while the site creation
- WP Multisite Static Frontpage
- Preview posts returns 404
- Multisite on Rackspace Cloud (ubuntu lucid)
- How to stop unlink images when remove a site or user
- What should I do? A multisite, a single website or many websites? [closed]
- Multiple homes for multiple languages [closed]
- WordPress multisite installation broke menu links
- Within the database, where is the flag which says that a user has Super Admin rights?
- Performance on WPMS
- Hosting a seperate wordpress project on localhost
- Bulk activate a theme on multisite
- Multisite development environment
- Removing a wordpress multisite installation and preserving the database before migrate to nginx
- How to host blog on separate domain from main site
- Database Tables Lost Indexes? How to Recover?
- How does WordPress determine which multisite the user is on from the URL?
- Multisite multidomain
- How to recover deleted site in WordPress Multisite?
- Query to import data from one MultiSite table to another (pages/sub-pages)
- WordPress Multisite domain mapping with different IPs
- Will changing the folder name two directories above a fresh wordpress installation break the site?
- Obtaining user table for one site on multisite set up
- new multisite, old db
- WordPress stuck in deleting user
- Renaming admin user on multisite install by MySQL
- How can I add custom meta on signup page and pass along to be used after blog activation?
- Set up Network Locally on a Flash Drive
- Migrating static site to multisite with multiple domains and subdomains
- WordPress multi-site, developing locally and syncing live changes
- muliple wordpress multisite installs on the same sever
- How To Run Multiple Multi-Site Networks On Same Box [closed]
- Replicate network plugins without having to configure it for each subsite?
- Delete all user’s meta without knowing all the ‘key’
- Different Domains in Multisite Setup
- WP MultiSite: Can’t select database error after changing to new domain
- How to publish some default pages in Multisite creation?
- add_blog_option blog ID
- How long is “as long as possible” in wp_cache_set()?
- more tables created when create a new site
- Pros and Cons of Post Types vs. Multiple Blogs
- How to create a blogs category page with Blog-Types Plugin
- Multisite subdomain-site redirects to primary site
- Can I use the main Multisite as a backend only?
- Search returns “Nothing Found” on a sub directory
- How To Upload Existing WordPress Site To WordPress Multisite Using SSH
- In Multisite: Site / Blog IDstill exists after deleting site
- WordPress Multisite with thousands of blog
- Delete all blogs on multisite
- Get multisite count without php?
- WordPress and SQL – Update and Insert from another table if column value doesn’t exist
- MySql Database In WordPress Multisite
- Multisite Tables the same as Single Install?
- Is there a built in method to protect pages?
- Plugin data shared in Multisite
- cannot access subsites in wordpress multisite
- Merging versions of wp_posts based on post_title
- Pointing multiple subdomains at the same WordPress Installation
- Set static page as default front page on newly created sites in multisite
- Create a Network of Different websites with wordpress
- Using common slider in all sites
- WordPress Multisite platform for different city for single db
- Should I go for Multisite or separate WP Installation?
- Integrating WordPress for blog and other content pages in a web app
- Could not find site error
- WordPress Multisite
- Too much slow queries with my multisite