473,738 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I export a MySQL table with a different name using phpmyadmin?

How can I export a MySQL table with a different name using phpmyadmin?

I want to export
nuke_bbsearch_w ordmatch
and all it contents to
phpbb_search_wo rdmatch
This table in a different db. Fields are the same just the name needs to be
changed. When exporting. I have been editting the rest of the table I need
manually bt editting them in notepad but the table 4 columns and has 170,000
entries.

Example:
I need to change entires like these 170,000 times
INSERT INTO `nuke_bbsearch_ wordmatch` VALUES (4146, 192, 0);
to
INSERT INTO `phpbb_search_w ordmatch` VALUES (4146, 192, 0);

Any help would be greatly appreciated.
Thanks in advance

Jaks
Jul 23 '05 #1
2 3361
jaks wrote:
How can I export a MySQL table with a different name using phpmyadmin?
I have been editting the rest of the table I need
manually bt editting them in notepad but the table 4 columns and has 170,000
entries.


I have a couple of possible solutions.

You could copy the table to the name you want and then back up that table:
CREATE TABLE phpbb_search_wo rdmatch SELECT * FROM nuke_bbsearch_w ordmatch;

Another solution is to use an editing solution other that Notepad (which
I eschew for a variety of reasons). Have you ever used Perl or sed?
I realize by mentioning notepad you must be on Windows. Stream-oriented
editing tools are not installed by default on Windows. But there are
several ports of UNIX-originating tools including Perl and sed available
for free:
http://www.activestate.com/Products/ActivePerl/
http://unxutils.sourceforge.net/
http://www.cygwin.com/

For instance, you could output your table dump using mysqladmin (or
mysqldump or whatever), and end up with a file "wordmatch. sql"
containing references to table "nuke_bbsearch_ wordmatch".

Then filter it with Perl:
C:> perl -pi -e 's/\bnuke_bbsearch _wordmatch\b/phpbb_search_wo rdmatch/g'
wordmatch.sql

The command above should use Perl to edit the file in place,
substituting the table names (the \b is to make sure that string is at a
word boundary).

Regards,
Bill K.
Jul 23 '05 #2
"nospamhere " wrote:
How can I export a MySQL table with a different name using
phpmyadmin?

I want to export
nuke_bbsearch_w ordmatch
and all it contents to
phpbb_search_wo rdmatch
This table in a different db. Fields are the same just the
name needs to be
changed. When exporting. I have been editting the rest of the
table I need
manually bt editting them in notepad but the table 4 columns
and has 170,000
entries.

Example:
I need to change entires like these 170,000 times
INSERT INTO `nuke_bbsearch_ wordmatch` VALUES (4146, 192, 0);
to
INSERT INTO `phpbb_search_w ordmatch` VALUES (4146, 192, 0);

Any help would be greatly appreciated.
Thanks in advance

Jaks


copy it to the similar named table, then rename the resulting table in
phpmyadmin (in operations tab).

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/mySQL-export...ict224317.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=773240
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3059
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I write some PHP code which should, I think, be able to to auto create the tables. The SQL looks like this:
11
2198
by: Joshua Beall | last post by:
Hi All, I am working on a registration system, and one of the things I am going to need to be able to do it setup the database tables for each event that I have registration for. Normally I would do this by hand, but I am wondering if there are any code libraries out there that could generate the SQL for me. Basically I would have a list of column names and types. I know I could just foreach() through the list, with a switch to...
0
3393
by: Ryan Schefke | last post by:
------=_NextPart_000_0077_01C34C8B.2B90C960 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ..I just sent this out to the win32 distribution list but no one has replied.can someone on this list please help? The issue should be trivial for experienced MySQL users, I'm just a novice, thanks!
1
2733
by: Martin Herrman | last post by:
Hi all, I have installed MySQL on my Linux Mandrake 10 workstation; I didn't change any default values (except for the user-accounts). I used a CMS to create a website which I want to upload to my hosting provider. When I export my database (using PHPMyAdmin) from my workstation to a local file and then on the server (again using PHPMyAdmin) I import the database from the local file, some characters are 'fucked up'.
1
3190
by: Gregory.Spencer | last post by:
Hi there, Using PHPMyAdmin and it is very usefully reporting problems with my MySQL DB. "PRIMARY and INDEX keys should not both be set for column `column_name`" and
4
1754
by: Dave Moore | last post by:
Hi All, I'm putting a website together using PHP and a MySQL database. I've been using phpMyAdmin as it makes updating the DB nice and easy. For development, I've been using Apache, MySQL and PHP installed on my local machine but now I'm having problems porting to my hoster's server. To transfer the database contents, I've exported the structure and data of my local DB to a .sql file and uploaded this to my hosted DB using phpMyAdmin on...
3
2078
by: Cynthia | last post by:
Hi all, I know this can be done, but I just can't seem to find a way to do it (that I can use myself, or understand). I use Mac and I've got some databases on my hosting company's MySql server that I use. I would like to take a database that's on my website and change it over to use the MySql database. It's currently using a flat file with pipes (|) to delineate each field. The "converters" I've found online are all for Windows, and...
0
3475
by: NewbieSupreme | last post by:
I'm using PHPMyAdmin on an Apache2Triad install (latest version; 5.x.x, which installs PHP5 and PHPMyAdmin 2.8 as well). In Access, I exported a table to a text file, tab-delimited, text qualifyer of "none" (this is how I read to do it from newsgroups). When I use the Query window in phpmyadmin to import the text file, it waits a while, then returns an error: #1064 - You have an error in your SQL syntax; check the manual that...
8
2009
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the same query at the CLI. I am having trouble executing a large query through my PHP script. It takes about 7-11 seconds on average to execute, whereas the same query only takes 0.01 seconds to execute through the CLI.
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.