MySQL

Resetting the ROOT password in a MySql server

If you haven't guessed, this blog contains things I need to remember because I make alot of stupid mistakes. This happens often when your brain is a sieve.

Anyhow, so with my last install of WAMP, I decided to be clever and give my 'root' privilege an actual password because I was tired of seeing that error is phpMyAdmin. LOL, well, so after I set it and tried to get into the phpMyAdmin ... I was locked out.

So, if that happens to you, try this:

  1. use the WAMP task bar manager and select the MySQL console or ...

Replacing strings in a specific table within phpMyAdmin

  1. In the phpMyAdmin interface for your site, navigate to the correct table
  2. Click the SQL tab, and in the SQL query box...
  3. Using this code and replacing the ** with correct information, test to see if you are replacing the correct string
    SELECT replace(*rowName*,'*original string*','*new string*'), *rowName* FROM `*table name*`   
  4. if this checks out, then use this code to replace the string:
    update *table name* set *rowName*= replace(*rowName*,'*original string*','*new string*');  
  5. Check the results

Access the Drupal Database

Here is a help file that I created for myself on how to access the database while writing a module. I thought that it might be useful. Later this week, I will create a post recapping Objects, Arrays and Functions: the stuff we talked about at the beginning of session 2 on Sunday at Drupalcamp, this weekend. Enjoy
<?php
// remember to bring the global variables into Scope
global $user;
/*the db_query() function does the selecting, inserting, deleting, and updating
Syndicate content