Here is step by step explanation on How to Check and Repair a MySQL Database Through Console SSH with Mysqlcheck and Myisamchk are similar in purpose, there are some essential differences. Mysqlcheck as well as Myisamchk can check, repair and analyze MyISAM tables. Mysqlcheck can also check InnoDB tables.
step 1: Log in as ‘root’ via SSH and:
step 2: Shows you if any need repair:
|
myisamchk --check /var/lib/mysql/*/*.MYI |
step 3: Recover MySql Database
try ‘safe-recover’ first:
|
myisamchk --safe-recover /var/lib/mysql/*/*.MYI |
and, if neither that nor this works:
|
myisamchk --recover /var/lib/mysql/*/*.MYI |
Then use the ‘force’ flag:
|
myisamchk --recover --extend-check --force /var/lib/mysql/*/*.MYI |
If those are not MyISAM tables try Mysqlcheck:
|
mysqlcheck --all-databases -r #repair databases mysqlcheck --all-databases -a #analyze databases mysqlcheck --all-databases -o #optimize databases |
to repair one database:
|
mysqlcheck -ro database_name |
to repair one table in database:
|
mysqlcheck -ro database_name table_name |
ref: vps.net
{ }
If you try to upload a file through http to your web site running on Apache2/PHP5/mod_fcgid, and in your browser you get the error:
|
Error 500, Internal server error |
In Apache’s error log you see something like
|
[Fri Jun 26 15:14:15 2011] [warn] [client 119.235.250.193] mod_fcgid: HTTP request length 131484 (so far) exceeds MaxRequestLen (131072), referer: ... |
First check in your php.ini that upload_max_filesize has a big enough value for your upload. By default it’s
Then open your Apache vhost configuration and add the FcgidMaxRequestLen directive with a big enough value (in bytes), for example
|
FcgidMaxRequestLen 2000000 |
which equals roughly 2 MB.
The default value is
|
FcgidMaxRequestLen 131072 |
which is very small (see http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestlen).
Finally restart Apache.
{ }
Set chmod a Folder or a file
|
chmod 755 [folder_name] chmod 755 [file_name] |
Set chmod all folders and files
If you really want to do is set the directories to 755 and either leave the files alone or set them to 644 for this you can use the find command e.g.
to change all the directories to 755:
|
find /path/to/folder -type d -exec chmod 755 {} ; |
to change all the files to 644:
|
find /path/to/folder -type f -exec chmod 644 {} ; |
{ }
If got message like MySQL Error: 1 (Can’t create/write to file ‘/tmp/#sql_7425_0.MYD’ (Errcode: 17)) or Warning: session_write_close(): write failed: No space left on device
you can check:
- Make sure that /tmp isn’t out of space
- Make sure that /tmp is chmod 1777
- If you’re using a virtual /tmp partition (/tmpDSK) make sure it’s not corrupt – if so replace it
If your /usr/tmpDSK is corrupted. You should stop all processes that have files open on /tmp such as MySQL and other applications using:
Delete all un-necessary files and then run the following command:
{ }
If you can not access into your server via ssh, and said : Connection refused
First step check your firewall whether the firewall has allowed ssh port ?
If you don’t have any firewall configuration, check your ssh server status
|
# /etc/init.d/sshd status openssh-daemon is stopped |
and then checking log at
if there is logs like the following errors.
|
vps sshd[18431]: fatal: daemon() failed: No such device |
Fixed by :
|
# rm -f /dev/null # mknod /dev/null c 1 3 |
Restart your ssh server
|
# /etc/init.d/sshd start Starting sshd: [ OK ] |
{ }
How to Fix FTP Not Working or FTP Connection Refused in Kloxo, please try the following command.
|
yum -y downgrade pure-ftpd sh /script/upcp sh /script/cleanup yum -y update service xinetd restart |
{ }
Recent Comments