Current location: Hot Scripts Forums » Other Discussions » Database » Change Password/Move Data


Change Password/Move Data

Reply
  #1 (permalink)  
Old 10-17-09, 01:04 AM
ghdsupport ghdsupport is offline
New Member
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Change Password/Move Data

1 - I want to change my password for my mysql database connection, because someone other than myself has it. I know the username/pass and I want to change the password. If i just change the password in the connect.php file then it will screw up my site, can you guys give me instructions on how to change it properly. Not the phpmyadmin pass, Im talking about the mysql database connect pass.

2 - I want to move some of my mysql row entries to another category.
Here is how my database is setup:
-database name: xxxxx_dataname
>then I have 3 tables called cats, layouts, users
>under cats I have 2 rows called Cars (categoryID 18), Money & Cars (categoryID 10)
>now, I want to move all of my Cars (categoryID 18) entries that are in the layouts table and put them into Money & Cars (categoryID 10).
I tried doing a query where I get about 43 rows and then I clicked on "Check/Edit All" but then I would have to change the categoryID's from 18 to 10 on 43 different rows individually? There has to be an easier way, is there?
Reply With Quote
  #2 (permalink)  
Old 10-18-09, 08:02 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by ghdsupport View Post
1 - I want to change my password for my mysql database connection, because someone other than myself has it. Not the phpmyadmin pass, Im talking about the mysql database connect pass.
MySQL stores the username and password in the 'user' table in the mySQL database. You can update or change the password for a user this way (the user name here is 'mike').

1) Login to the mysql server and type following command at shell prompt:

mysql -u root -p
(enter the username and password when prompted)

2) To switch to the mysql database, type:

use mysql;

3) Change password for user mike:

update user set password=PASSWORD("NEWPASSWORD") where user='mike';

4) Reload privileges:

flush privileges;
quit




Quote:
Originally Posted by ghdsupport View Post
I tried doing a query where I get about 43 rows and then I clicked on "Check/Edit All" but then I would have to change the categoryID's from 18 to 10 on 43 different rows individually? There has to be an easier way, is there?
Run a query to update all of the rows that the first query returned:

UPDATE cats SET categoryID = '10' WHERE categoryID = '18'
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 05:08 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.