EZ Linux Admin random header image

How to import and export a large mysql file

March 25th, 2014 by EZ linux · No Comments

If you need to import or export a large mysql file, you can forget about phpmyadmin. I was stuck with a 2 gig file and needed a solution. The easiest and only way I could find was to upload the file through root with winSCP and run these command.

To export:
mysqldump --opt -Q -u username_username -p username_db > /home/dwhs_wrdprss1.sql

To import:
mysql -u username_username -p username_db < /home/dwhs_wrdprss1.sql

→ No Comments Tags: Linux Images


Raising the upload limit in phpmyadmin for CPanel

March 24th, 2014 by EZ linux · No Comments

Firs you need to find the phpmyadmin php.ini file. Use this command to find all php.ini files:

find /usr -name php.ini

Then find the path to the php.ini file that is listed in the “phpmyadmin” folder.

Mine was

/usr/local/cpanel/3rdparty/etc/phpmyadmin

Next find these two section and change the limit how you want:

upload_max_filesize = 150M
AND
post_max_size = 150M

I wouldn’t go above 200

Than restart cpanel from the command line:

service cpanel restart

→ No Comments Tags: Cheat Sheets · Cpanel and WHM · Linux Software / Scripts · Linux Tricks


Switch VLan setting meanings for no, tagged, untagged, forbid.

March 19th, 2014 by EZ linux · No Comments

When you add your Vlan each port will need to be set to one of these:

no
tagged
untagged
forbid

Here is the definitions for each network switch Vlan setting:

Tagged:

Allows the port to join multiple VLANs.

Untagged:

Allows VLAN connection to a device that is configured for an untagged VLAN instead of a tagged VLAN. A port can be an untagged member of only one port-based VLAN.
A port can also be an untagged member of only
one protocol-based VLAN for any given protocol type.
For example, if the switch is configured with the default VLAN plus three protocol-based
VLANs that include IPX, then port 1 can be an untagged member of the default VLAN and one of the protocol-based VLANS.

No:

Appears when the switch is not GVRP-enabled; prevents the port from – or – joining that VLAN.

Auto:

Appears when GVRP is enabled on the switch; allows the port to
dynamically join any advertised VLAN that has the same VID

Forbid:

Prevents the port from joining the VLAN, even if GVRP is enabled on the switch.

→ No Comments Tags: Hardware · Networking · Ports


How to amend the emails from Cpanel backups to the current account

March 13th, 2014 by EZ linux · No Comments

If a customer happens to delete their emails you can still retrieve them from the cpanel backup system. This will take root access to move the files from the backup folder tot he customers account.

You can extract a backup archive and copy over the emails to an account’s existing mail directory. If restoring a backup archive, you will find emails located at:

Code:
/home/cpmove-username/homedir/mail/domain.com/email-account/

You can also find emails from the default account within:

Code:
/home/cpmove-username/homedir/mail/

The following thread is intended for manual migrations to cPanel, but it includes details about the maildir structure that will be useful to you:

Manual Migrations to cPanel

→ No Comments Tags: Cpanel and WHM · Linux Back Up · Linux Commands · Linux Software / Scripts · Linux Tricks


Removing the eximstats file

March 1st, 2014 by EZ linux · No Comments

You can modify the following option in “WHM Home » Server Configuration » Tweak Settings” under the “Stats and Logs” tab:

“The interval, in days, to retain Exim stats in the database”

Reducing this value will decrease the amount of data that is stored in the Eximstats database.  If you decide to drop the eximstats tables completely, you can generate a new instance of the tables via:

Code:
/usr/local/cpanel/bin/updateeximstats

→ No Comments Tags: Cheat Sheets · Cpanel and WHM · Linux Commands · Linux Software / Scripts · Linux Tricks


How to find inodes use per user or group

February 28th, 2014 by EZ linux · No Comments

This simple command will list the inodes used for any group on the server:
repquota -a | head -n5 ; repquota -a | grep username
Just replace where it says “username” with the group or username you want to check.

→ No Comments Tags: Cheat Sheets · Cpanel and WHM · Linux Commands · Linux Software / Scripts · Linux Tricks


How to upgrade mysql with cloudlinux and cpanel

February 21st, 2014 by EZ linux · No Comments

Using the mysql upgrade option in cpanel will not work with cloud Linux. It’s also a little different than what the Cloudlinux site says.

How to install new package:
1) yum install governor-mysql –enablerepo=cloudlinux-updates-testing
2) /usr/share/lve/dbgovernor/mysqlgovernor.py –install

For upgrading to MySQL 5.5(for example), you should to do:
1) /usr/share/lve/dbgovernor/db-select-mysql –mysql-version=mysql55
2) /usr/share/lve/dbgovernor/db-select-mysql –install-now
3) for cPanel can be needed to rebuild php through easyapache

→ No Comments Tags: Cpanel and WHM · Linux Software / Scripts


Find and replace mysql

February 6th, 2014 by EZ linux · No Comments

update [table_name] set [field_name] = replace([field_name],’[string_to_find]‘,’[string_to_replace]‘);

Make sure and remove the [] tab when entering the variable.

If you know how to do this database wide without needing the table listed please post in the comments.

→ No Comments Tags: Linux Commands · Linux Tricks


How to back up and restore a MYSQL database by command line

January 9th, 2014 by EZ linux · No Comments

Here is how to back up and restore a MYSQL database by command line

Back up a MYSQL database:

Code: ——— mysqldump –opt -Q -u dwhs_dwhs -p dwhs_wrdprss*A* > /home/dwhs/workroom/dwhs_wrdprss1.sql ———

Restore a MYSQL database:

Code: ——— mysql -u dwhs_dwhs -p dwhs_wrdprss*B* < /home/dwhs/workroom/dwhs_wrdprss1.sql ———

→ No Comments Tags: Cheat Sheets · Cpanel and WHM · Linux Commands · Linux Tricks


How to upgrade mysql on a Cpanel Cloud Linux server

January 8th, 2014 by EZ linux · No Comments

How to install new package:
1) yum install governor-mysql –enablerepo=cloudlinux-updates-testing
2) /usr/share/lve/dbgovernor/mysqlgovernor.py –install

For upgrading to MySQL 5.5(for example), you should to do:
1) /usr/share/lve/dbgovernor/db-select-mysql –mysql-version=mysql55
2) /usr/share/lve/dbgovernor/db-select-mysql –install-now
3) You will need cPanel to rebuild php through easyapache next to finish the procedure.

→ No Comments Tags: Cpanel and WHM · Installing Linux · Linux Operating Systems · Linux Tricks