Archive for the tag 'database'

How to reconfigure and change status for domain in plesk database.

Reconfigure Domain:

/usr/local/psa/admin/sbin/websrvmng –reconfigure-vhost –vhost-name=domain.com

Change the status for domain:

/usr/local/psa/bin/domain -u domain.com -status enabled

You should get a message the Object successfully enabled, once that is done the domain should be unsuspended in Plesk.

How to access psa database in Plesk Server

We can access plesk psa database, from the Linux command line (via ssh) and from the Plesk control panel.

The /etc/psa/.psa.shadow file contains the Plesk admin password.

So to access the database run the following command.

mysql -uadmin -p`cat /etc/psa/.psa.shadow`

Select the psa database.

mysql> use psa;

To view all the tables

mysql> show tables;

MySQL database does not work and returns “Can’t create/write to file” error

The problem is related to the mysql directory permission.

‘mysql’ user is not able to create a temporary file in /var/lib/mysql/ directory due to permissions lack

# ls -lda ~mysql/

drwxr-xr-x 5 root mysql 4096 Aug 31 09:56 /var/lib/mysql/

The solution is to go to /etc/init.d/mysqld_app_init file and change

chown root.mysql /var/lib/mysql

to

chown mysql.mysql /var/lib/mysql

Then restart mysqld service or just change owner of /var/lib/mysql directory to “mysql” instead of “root”

chown root /var/lib/mysql

mysqldump - a database backup program

The mysqldump client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server).

If you are doing a backup on the server and your tables all are MyISAM tables, consider using the mysqlhotcopy instead because it can accomplish faster backups and faster restores. See mysqlhotcopy(1).

There are three general ways to invoke mysqldump:

shell> mysqldump [options] db_name [tables]
shell> mysqldump [options] –databases db_name1 [db_name2 db_name3...]
shell> mysqldump [options] –all-databases

If you do not name any tables following db_name or if you use the –databases or –all-databases option, entire databases are dumped.

SBDavid

Creating the postfix aliases database

Creating the postfix aliases database

Postfix uses a Sendmail-compatible aliases(5) table to redirect mail for local(8) recipients. Typically, this information is kept in two files: in a text file /etc/aliases and in an indexed file /etc/aliases.db. The command “postconf alias_maps” will tell you the exact location of the text file.

root@dell:~# postconf alias_maps
alias_maps = hash:/etc/aliases
root@dell:~#

First, be sure to update the text file with aliases for root, postmaster and “postfix” that forward mail to a real person. Postfix has a sample aliases file /etc/postfix/aliases that you can adapt to local conditions.

/etc/aliases:
root: you
postmaster: root

Note: there should be no whitespace before the “:”.

Finally, build the indexed aliases file with one of the following commands:

# newaliases
# sendmail -bi

« Prev - Next »