http://wiki.phpmyadmin.net/pma/Welcome_to_phpMyAdmin_Wiki
http://wiki.phpmyadmin.net/pma/Config
Showing posts with label phpMyAdmin. Show all posts
Showing posts with label phpMyAdmin. Show all posts
Monday, December 5, 2011
Thursday, September 29, 2011
nginx and phpmyadmin alias
Category:
Nginx,
phpMyAdmin
— SkyHi @ Thursday, September 29, 2011
Default Ubuntu nginx root:
Configure nginx.conf to add the subdomains:
Restart nginx to test the subdomain.
sudo /etc/init.d/nginx restart
REFERENCES
http://www.base-10.net/blog/2009/11/06/nginx-and-non-document-root-phpmyadmin/
http://blog.rubynginx.com/index.php/2010_01_25/setup-awstats-phpmyadmin-phppgadmin-with-nginx-on-ubuntu/
### download the raw source code .tar.gz location /phpmyadmin { #Default Ubuntu nginx root root /usr/share/nginx/www; index index.php; } location ~ ^/phpmyadmin.+.php$ { #Default Ubuntu nginx root root /usr/share/nginx/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
Configure nginx.conf to add the subdomains:
#sudo apt-get install phpmyadmin server { listen 80; server_name phpmyadmin.domain1.com phpmyadmin.domain2.com; location / { root /usr/share/phpmyadmin; index index.php; } location ~ .php$ { fastcgi_pass 127.0.0.1:49232; #this must point to the socket spawn_fcgi is running on. fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin/$fastcgi_script_name; # same path as above include /etc/nginx/fastcgi_params; } }
Restart nginx to test the subdomain.
sudo /etc/init.d/nginx restart
REFERENCES
http://www.base-10.net/blog/2009/11/06/nginx-and-non-document-root-phpmyadmin/
http://blog.rubynginx.com/index.php/2010_01_25/setup-awstats-phpmyadmin-phppgadmin-with-nginx-on-ubuntu/
Tuesday, May 3, 2011
Global Find and Replace In WordPress using MySQL phpmyadmin
Category:
find_and_replace,
MySQL,
phpMyAdmin
— SkyHi @ Tuesday, May 03, 2011
In case you ever need to find and replace a text string in every post or page of your WordPress site, this SQL code will help you out. I recently had to move a client’s website from staging into production, and just when I was getting ready to publish the new site I realized WordPress’s HTML editor had hard-coded the URLs of every image in every post to the address of the staging server. This is actually a feature of WordPress; when you upload an image into a post or page it uses an absolute URL, not a relative one. This really helps you out if any of your posts get picked up via RSS and published elsewhere, since the images will remain intact thanks to the absolute URLs.
This code will search through every “post_content” field in the wp_posts table and replace the staging URL address (staging.server.com) with the production address (www.productionserver.com). The format is easy to understand and can of course be used with any MySQL table, not just WordPress:
I realize this isn’t the most complex or enlightening code sample, but I hope this helps anyone stuck with an annoying repetitive text string in all your WordPress posts which you’d like to search and replace with one quick command.
To search and replace a text string, start up phpMyAdmin, and click on your database name that you want to run the search and replace through. At the top of the window, click on the "SQL" tab.
In the text box, enter the following code. This is the generic setup, so edit to satisfy your needs:
You can add a WHERE clause onto this as well.
For example, here is one command a ran:
This got rid of all paragraph tags in the mos2_content table where the title included the string "-0".
Hope this helps. If you have any comments, suggestions, questions, or your own code, please submit a comment below.
REFERENCES
http://www.barrywise.com/2009/02/global-find-and-replace-in-wordpress-using-mysql/
http://brockangelo.com/2008/11/09/search-and-replace-mysql-using-phpmyadmin/
http://www.zimmertech.com/tutorials/php/60/mysql-search-replace-phpmyadmin.php
NOTE: An absolute URL is the fully qualified path to a resource; such as http://www.barrywise.com/images/image.jpg. A relative URL will only work when the file is relative to the path of the current page, such as ../images/image.jpg.So here I was with a couple hundred pages of content with image URLs all pointing to the wrong address on the staging server. I needed a quick way to do a find and replace on every post in the WordPress MySQL database. It was actually pretty simple. In my case, I just had to execute this SQL code against the MySQL WordPress database:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'staging.server.com', 'www.productionserver.com');
This code will search through every “post_content” field in the wp_posts table and replace the staging URL address (staging.server.com) with the production address (www.productionserver.com). The format is easy to understand and can of course be used with any MySQL table, not just WordPress:
UPDATE [your_table_name] SET [your_table_field] = REPLACE([your_table_field], '[string_to_find]' , '[string_to_be_replaced]');
I realize this isn’t the most complex or enlightening code sample, but I hope this helps anyone stuck with an annoying repetitive text string in all your WordPress posts which you’d like to search and replace with one quick command.
This is a life-saver: an easy way to search any table inside your database and replace one string of text with another. It works like a charm. But be careful, search first to see the results of your query before you commit the changes, and always backup prior to any database work.
Here is how you test the waters safely:
SELECT * FROM `wp_posts` WHERE `post_content` LIKE '%oops%'
Translation:
SELECT * FROM `table_name` WHERE `field_name` LIKE '%unwanted_text%'
And here is how you do some damage:
UPDATE `wp_posts` SET `post_content` = replace(post_content, 'oops', 'much better')
And translated:
UPDATE `table_name` SET `field_name` = replace(same_field_name, 'unwanted_text', 'wanted_text')
Search and Replace in MySQL database with phpMyAdmin
Do a search and replace in any MySQL database in phpMyAdmin. You do not need to download the database export at all, just run this simple command. This also works through the MySQL command line.To search and replace a text string, start up phpMyAdmin, and click on your database name that you want to run the search and replace through. At the top of the window, click on the "SQL" tab.
In the text box, enter the following code. This is the generic setup, so edit to satisfy your needs:
UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring");
You can add a WHERE clause onto this as well.
For example, here is one command a ran:
UPDATE `mos2_content` SET introtext = replace(introtext,"<p> ","") WHERE `title` REGEXP '-0';
This got rid of all paragraph tags in the mos2_content table where the title included the string "-0".
Hope this helps. If you have any comments, suggestions, questions, or your own code, please submit a comment below.
REFERENCES
http://www.barrywise.com/2009/02/global-find-and-replace-in-wordpress-using-mysql/
http://brockangelo.com/2008/11/09/search-and-replace-mysql-using-phpmyadmin/
http://www.zimmertech.com/tutorials/php/60/mysql-search-replace-phpmyadmin.php
Subscribe to:
Posts (Atom)