Adding a field to a 3 gb database table

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
LVL 9
syedasimmeesaqAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

todd_farmerCommented:
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
syedasimmeesaqAuthor Commented:
how to do it from command line ? I mean the syntax.
Thanks
0
todd_farmerCommented:
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
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

syedasimmeesaqAuthor Commented:
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
todd_farmerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
syedasimmeesaqAuthor Commented:
ok thanks a lot
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.