PDA

View Full Version : Repair/Optimize Post table outside of admincp


Dabbler
Sun 10th Jul '05, 4:19pm
MySQL newbie question:

My post and post_index tables are too large apparently for the admincp script to handle.

I assume I can still handle the task from within a MySQL console.
What commands would be used for this?


Win2003 SP1
IIS 6.0
MySQL 4.0.24
vB 3.0.7

TIA,

Zachery
Sun 10th Jul '05, 4:30pm
All the admincp is doing is passing commands to mysql but via php. You can do this yourself via the command line.

i.e. in shell/telnet/ssh type while mysql is running and forum is CLOSED:

mysqlcheck -r -u mysqlusername -p databasename

via myisamchk repair functions while mysql is shutdown/stopped in shell/telnet/ssh type :

myisamchk -r -u root -p databasename

the second option most likely requires server and mysql root access to first stop mysql and then run myisamchk repair options.

Dabbler
Sun 10th Jul '05, 4:42pm
Sorry, but I'm really a newbie with this.

I have full control over the server and the forums are presently turned off.

My plan was to do this via an RDC session using command.com.

For:
mysqlcheck -r -u mysqlusername -p databasename

1 - does "databasename" refer to the individual table or to the full database?

2 - So in my case, is this what you mean:
mysqlcheck -r -u root -p forums

3 - And does "mysqlcheck" do the actual repair and/or optimization?

4 - Can I restrict the repair/optimization to a single table?

For:
myisamchk -r -u root -p databasename

1 - do i need to do this also, or is this a second way to accomplish the same thing as done via the first command.

2 - Is this also a command from within the MySQL session?

Zachery
Sun 10th Jul '05, 5:19pm
1. yes
2. yes

I believe so, but its best to let it have a full run at your database anyway.

don't use commnad, use cmd (command is the older non .net version of dos, and does not have all of the extensions avaible, cmd is the windows xp version..)

your going to basicly issue

c:\mysql\bin\>mysqlcheck -r -uroot -ppassword forum

and let it run. It may take awhile but it should fix the issue.

Dabbler
Sun 10th Jul '05, 5:35pm
super duper
Thanks

On our old server, using a mysql REPAIR TABLE command, it would take about half an hour to complete the post repair/optimize.

This new server only takes about 2 minutes for all tables.

Zachery
Sun 10th Jul '05, 5:43pm
Isn't great insanely powerful hardware awsome? :D

Dabbler
Tue 12th Jul '05, 12:34pm
mysqlcheck runs OK for all tables except one:
cpsession
for which it returns an error of:
error : the handler for the table doesn't support repair

Also, cpsession only has an .frm file in the data dir but no .MYI or .MYD file.

Is this normal?

Zachery
Tue 12th Jul '05, 1:23pm
Thats abit concerning, it should return that for two tables. But yes that is the correct error, cpsession and session should both be heap.

go into phpmyadmin and see what your session table is set to use. if it is anything besides heap, change it to heap.

Dabbler
Tue 12th Jul '05, 3:39pm
Is there a command line to achieve the same thing?