Archive for the tag 'mySQL'

Will manually updated MySQL,work with cPanel & WHM?

Yes, but you will need to disable MySQL updates on the Update Preferences screen:

1. Go to Main >> Server Configuration >> Update Preferences.
2. Under cPanel Package Updates >> mysqld, click Never.
3. Click Save at the bottom of the page.

There may be compatibility problems with any software you choose to install manually.

Cpanel only supports MySQL versions that they supply with cPanel & WHM.

How to update or change the version of MySQL in Cpanel?

To update MySQL, run

/usr/local/cpanel/scripts/mysqlup

from the command line.

To change the MySQL version, go to Main >> Software >> MySQL Upgrade in WHM.

Cpanel disk space consumed by an account’s MySQL and PostgreSQL database

To enable this feature toggle the following Tweak Setting:

When displaying disk usage in cPanel/WHM include Postgresql and MySQL® disk usage.

As with the database counts, the disk usage calculation is handled by /scripts/update_db_cache which executes every 4 hours. This script is executed upon enabling the Tweak Setting. Administrators may also execute this script to recalculate the figures.

The disk usage figures are stored in /var/cpanel/datastore/mysql-disk-usage and /var/cpanel/datastore/postgres-disk-usage.

cat /var/cpanel/datastore/mysql-disk-usage

Support for /scripts/updatemysqlquota ends as of cPanelTM 11.25.0. Per this change /scripts/updatemysqlquota is no longer distributed with the product.

Reference: http://cpanel.net

Finding help content for MySQL databases administration.

Run ‘help contents’ for a list of all accessible topics

mysql> help contents

You asked for help about help category: “Contents” For more information, type ‘help [item]‘, where [item] is one of the following categories:
Account Management
Administration
Compound Statements
Data Definition
Data Manipulation
Data Types
Functions
Functions and Modifiers for Use with GROUP BY
Geographic Features
Language Structure
Table Maintenance
Transactions
User-Defined Functions
Utility

To go to the individual catefories run the following example command.

mysql> help Account Management

You asked for help about help category: “Account Management” For more information, type ‘help [item]‘, where [item] is one of the following topics:
CREATE USER
DROP USER
GRANT
RENAME USER
REVOKE
SET PASSWORD

Creating and editing users in MySQL from shell prompt.

First we need to login into MySQL server as root.

mysql -u root -p

Will be prompted for your MySQL root password (note this is not the same as the server root password).

mysql> create user ‘buddy@localhost’ identified by ‘new-password’;
Query OK, 0 rows affected (0.12 sec)

Next we need to flush the privileges which reloads the ‘user’ table in MySQL - do this each time you add or edit users.

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

To give the user buddy select permission on all the databases, this allows the user to read, but not edit and delete.

mysql> grant select on *.* to ‘buddy’@'localhost’;
Query OK, 0 rows affected (0.00 sec)

The GRANT statement enables system administrators to create MySQL user accounts and to grant rights to accounts. To use GRANT, you must have the GRANT OPTION privilege, and you must have the privileges that you are granting. The REVOKE statement is related and enables administrators to remove account privileges.

« Prev - Next »