Tag: mysql

MYSQL: Default Basic Table Structure WordPress

If you use WordPress and have tested some plugins and removed them later, it is possible that you have much waste tables still inside your database. First do Database Backup with MySQL DUMP Then check it enter the mysql console as your mysql admin user and do: $mysql -u mysqladminusername -p mysql > use databasename; mysql > show tables; System echo: +—————————+ | Tables_in_wordpressdatab | +—————————+ | wp_commentmeta            | | wp_comments               | | wp_links                  | | wp_options                | | wp_postmeta               | | wp_posts                  | | wp_term_relationships     | | wp_term_taxonomy          | | wp_termmeta               | | wp_terms                  | | wp_usermeta               | | […]

WordPress: Change Word on all content sites with mysql

If you run a WordPress Blog or other CMS with MySQL Backend you can easy change one same word or expression on all content sites on the fly Do a mysqldump at first of the current database $ mysqldump -u username -p dbname > dbbackup.sql Login to the MySQL server Console Switch to the Database mysql> use dbname; run command for tests, lists touched posts mysql> SELECT * FROM wp_posts WHERE (post_content LIKE '%expression%'); Run Replace code to pre, cause i use preformat text plugin for the copy & paste boxes mysql> UPDATE wp_posts SET post_content = REPLACE ( post_content, […]

WordPress: Monitor the Size of the MYSQL Database

If you use WordPress or a other Blog Software with a MySQL Database over years it is useful to do some things regularly: Check the Database Size weekly, that no Skript Kid has found a Backdoor and fills up the Database silent Purge Database Caches with default maintenance tools of the Software Dont forget to create a MySQL Dump Backup weekly with cron To Check the Size login on mysql command prompt do: $mysql -u dbuser -p #Enter Password mysql > use dbwordpress mysql > SELECT table_schema "Data Base Name", sum( data_length + index_length) / 1024 / 1024 "Data Base […]

WordPress: Change User Password manual on mysql prompt

If you don’t want to use Passwords generated by wordpress itself, you can do it manual on a MYSQL Console howto: Login to your Webserver with the Database via encrypted SSH!! Login to the MYSQL Server Conssole with $ mysql -u username -p Enter Password, and change database with mysql>use database-name-of-blog Now Set Password for the User mysql>UPDATE wp_users SET user_pass = MD5('NEWPASSWORD-16-DIGITS') WHERE user_login = "THEUSERNAME"; System shows Echo: mysql> ok.. Changed 1 Row.. Quit mysql> exit Logout of SSH

WordPress: Replace or Purge Text on all Posts by mysql

If you have to remove a link, text or else on all wordpress posts pages with same signs like the “read more” tag do: mysql -u dbadmin -p – enter password – change database by: use databasename – run change command(SET “more-tag-source-html-pre” WordPress reformat the output here! ): mysql > UPDATE wp_posts SET post_content = REPLACE (post_content,'<!!–more–>',''); – System Echo’s: Query OK, 88 rows affected (0.01 sec) Rows matched: 706 Changed: 88 Warnings: 0