Databases

image 39 - PHPMyAdmin doesn't show all databases in cPanel

PHPMyAdmin doesn’t show all databases in cPanel

New databases that are created in cPanel are not visible in PHPMyAdmin, but if you assign a user to it and access it as that user, then you can use it. The first thing to check is if the database is visible via CMD: mysql -uCPANEL_USERNAME -p If the...

error phpmyadmin cpanl - PHPMyAdmin Access denied for user X @ localhost

PHPMyAdmin Access denied for user X @ localhost

When you can’t log in to PHPMyAdmin from within cPanel it’s mainly one of two reasons: When you reset the password for that user, MySQL password wasn’t changeduser has a custom .my.cnf file with defined logins for mysql Step 1...

image 80 - Create a new MySQL user dedicated to backups

Create a new MySQL user dedicated to backups

I recommend setting a new MySQL user for backups and never using the root MySQL account to do backups. Step 1. Log on to MySQL as root: mysql -u root -p Step 2. Create a new user and grant all necessary permissions: CREATE USER...

image 79 - Change MySQL data directory in PHPMyAdmin

Change MySQL data directory in PHPMyAdmin

In a recent article, I discussed many methods for removing the large ibdata file, one of which involves transferring the MySQL data directory to a different partition. However, if you do so, you must also inform PHPMyAdmin of the location of the...

image 34 - MySQL: 6 ways to move data from huge ibdata file to .ibd files

MySQL: 6 ways to move data from huge ibdata file to .ibd files

ibdata file is used to store all tables of databases that use the innoDB engine, so if you delete it, you will lose all data. To keep each database files in a separate file add innodb_file_per_table in your my.cnf file under [mysqld] section. Here...

postgre db backup script - Postgres DB backup script

Postgres DB backup script

To export a postgres database We use the pg_dump command: pg_dump -U postgres -v DATABASE -f FILENAME.sql And to import it back we use psql: psql -U postgres -W -d "FILENAME.sql" < FILENAME.sql Now that we know these commands We can easily create...

mysql backup script - Shell Script to Backup All MySQL databases

Shell Script to Backup All MySQL databases

Here is a simple bash script that I use to backup all mysql databases from the server: #! / bin / bash TIMESTAMP = $ (date + "% F") //backups will be stored in /backup/mysql BACKUP_DIR = "/ backup / mysql" MYSQL = / usr / bin / mysql MYSQLDUMP = /...