473,837 Members | 1,696 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 3367
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
3064
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
2205
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
3400
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
2737
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
3196
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
1759
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
2080
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
3484
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
2015
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
9846
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
9683
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10883
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...
0
10579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10633
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,...
1
7814
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5674
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...
1
4479
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.