[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Adding a field to a 3 gb database table

Posted on 2006-04-14
6
Medium Priority
?
243 Views
Last Modified: 2008-03-03
Hello experts

I have a huge approx. 3 gb database. I need to add only one field called Nowest in the mysql database PPP
I tried using navicat and mysql Administrator but both of the programs just take too long. I think it could be because of the ODBC connection. What can I do to add this field real fast?

Thanks
0
Comment
Question by:syedasimmeesaq
  • 3
  • 3
6 Comments
 
LVL 30

Expert Comment

by:todd_farmer
ID: 16455766
I'm sure that neither Navicat nor MySQL Administrator use the ODBC driver interface - that's a bit slower.  You're not likely to find faster performance, but you could try it from the mysql command-line client.
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 16455824
how to do it from command line ? I mean the syntax.
Thanks
0
 
LVL 30

Expert Comment

by:todd_farmer
ID: 16455868
ALTER TABLE PPP ADD COLUMN Nowest INT NOT NULL DEFAULT 0;

would create a new INT column named Nowest into the PPP table and populate it with a default value of 0, for instance.
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 16455959
PPP is the database and NIV is the table...I hae 3 databases in the mysql. Wouldn't I have to define a database for operation as in Alter table NIV column Nowest INT NOT NULL DEFAULT 0; we don't define which database to be updated. Also Integer could be NULL too by default.

Thanks
0
 
LVL 30

Accepted Solution

by:
todd_farmer earned 2000 total points
ID: 16456100
Yes, the above statement assumes you have alredy selected the appropriate database using the USE dbname; command.  You can do the modification without it like so:


ALTER TABLE PPP.NIV ADD COLUMN Nowest INT;
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 16456872
ok thanks a lot
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
Article by: Tammy
MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief forma…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

608 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