Solved

find and replace mysql

Posted on 2014-10-24
3
265 Views
Last Modified: 2014-10-25
In this case, I have several tables which have a clientid of 30.
I need to find every single instance and switch those over to clientid 150.

I am using phpmyadmin in this case but can also do this from the command line if needed.

mysql-server-5.5.40
0
Comment
Question by:projects
  • 2
3 Comments
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 40404055
Quick and dirty..  For each of the tables you need to change:
UPDATE <tablename> SET clientid=150 WHERE clientid=30

Open in new window

0
 

Author Comment

by:projects
ID: 40404379
Thank you. I'm amazed that I wasn't able to find something this simple when searching the net.
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 40404440
You can find more information in the MySQL docs.  Good luck!
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now