Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
MySQL Database not responding after adding an index to one of the tables
Old 05-18-2009, 09:17 AM MySQL Database not responding after adding an index to one of the tables
Banned

Posts: 81
Location: kavoir.com
Trades: 0
I have a database named mydb that has 3 tables:

table1 = 1,400,000 rows
table2 = 4,000 rows
table3 = 100,000 rows

and ever since I tried to add an indexing to table3, it's not responding.

I can't open any of the 3 tables in phpmyadmin (it keeps loading forever, but I can successfully load the database page with the list of tables though) and I can't access the tables via 'mysql' command from SSH (but I can log in though). When I perform 'use mydb' (without -A switch for mysql in command line), it seems to be loading the database structure (table information) forever; with the -A switch for mysql, 'use mydb' works but not 'SELECT * FROM table3 LIMIT 1' nor whatsoever - it's loading forever and not responding at all.

My initial guess is that the indexing is still going on as the table has like 100,000 rows. Can that be the reason? But it's been like 24 hours.

I'm so horrified that I may have broken the database? How can I get it to respond or how can I get a backup of it so that I can create a grand new database from this one?

Thanks and in need of help very much!
yangyang is offline
Reply With Quote
View Public Profile Visit yangyang's homepage!
 
 
Register now for full access!
Old 05-18-2009, 10:03 AM Re: MySQL Database not responding after adding an index to one of the tables
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
It looks lilke your db is stuck in a bad state.
Even creating an index on a multi million rows table should be done in a matter of minutes, not hours...

If you can access your server via ssh, I deduct that it's either an vps, or a private server.
In that case, I'd suggest you to try to restart the mysql service.
To do that, you need to become the admin on the server.
It can be done via the command "su" or "sudo".

su is the privilage escalation program to the super user. You have to be both allowed to use it, and to provide the super user (root) password.
It's usage is
Code:
su -
< enter root password >
/etc/init.d/mysql restart
sudo is a program that allows you to launch a process as the root, without escalating all your session to the root account.
You still need to be authorized to use the program, but this time, it's your personal account password that will be asked:
Code:
sudo /etc/init.d/mysql restart
< enter your user password >
If you have error messages sent back by the db, I'd suggest you to do a table repair.
Here is the documentation about it:
http://dev.mysql.com/doc/refman/5.0/...air-table.html
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to MySQL Database not responding after adding an index to one of the tables
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10090 seconds with 12 queries