mysql database

  1. K

    Steps to take backup database from shell

    You can use below command to take backup of your database. # mysqldump database_name > backup.sql After that you can restore your database with below command: # mysql database_name
  2. K

    Steps to take backup database from shell

    You can use below command to take backup of your database. # mysqldump database_name > backup.sql After that you can restore your database with below command: # mysql database_name
  3. K

    Changing Database Port of WordPress Website

    WordPress uses MySQL as its database by default. When you start using WordPress, the database port will be set to something by default by the hosting provider. In most cases, you don’t have to worry about finding it out or changing it. But in other instances, changing database port of your...
  4. K

    Steps to kill MySQL connections on server

    If you are making too many database connections then you will get error “too many database connections”, to resolve this error you can manually terminate database connections. Most quick and easy ways to terminate or kill MySQL connections is to restart MySQL services. You can use below command...
  5. K

    Steps to restore MySQL grants

    Script restoregrants which is available in /usr/local/cpanel/bin/restoregrants location helps to restore database users from data which is available in /var/cpanel/databases/grants_* files. You can use below command: /usr/local/cpanel/bin/restoregrants [--cpuser=cpuser] [--db=mysql|pg]...
  6. K

    Steps to convert database tables from InnoDB to MyISAM

    If you want to convert your database tables to MyISAM then you can follow below steps.But for that it is must to have root access of your database. You have to first dumped your SQL file via mysqldump and for that we have to replace "ENGINE=INNODB" with "ENGINE=MyISAM". You can check below...
  7. K

    Resolve Error “Restarting MySQL due to my.cnf modifications."

    Mysqluserstore script helps to update users.db and users.db.cache file. You can check location of these files : /var/cpanel/databases/users.db /var/cpanel/databases/users.db.cache After that you will get below error: [mysqluserstore] Restarting MySQL due to my.cnf modifications. You have to...
  8. K

    Steps to enable error log in MySQL database

    If you want to enable mysql error log then explicitly you have to enable option /etc/my.cnf file and after that you have to restart mysql service. You have to follow below steps: Login to server via SSH as root. Here check your /etc/my.cnf file and add below line in [mysqld] section...
  9. K

    Steps to turn off Event scheduler in Mysql database

    If you are using MySQL 8 version then you must know that Event Scheduler is enabled by default. You have to modify etc/my.cnf file, you have to add below line under [mysqld] section. event_scheduler=off After that you have to restart mysql service to reflect the changes.
  10. K

    How to increase max_allowed_packet in mysqldump?

    You can increase the max_allowed_packet in my.cnf file. You have to edit my.cnf file and add below line in my.cnf file. First you have to find [mysqldump] section in /etc/my.cnf file and then add below code : [mysqldump] max_allowed_packet=268435456 You can add value according to your choice.
  11. K

    Steps to set default storage engine for database

    Storage engines are software components which help DBMS to create, read, update and delete. We can also change storage engine for database. By default mysql 5.5 and later storage engine is InnoDB. We can change the default storage engines in my.cnf file. In this file we have to update...
  12. K

    mysql error “out of resources”

    You are getting this error while opening a file which means mysql file open permission has been exceeded. Open files limit can be managed by open_files_limit variable, we can run below query in phpmyadmin: SHOW VARIABLES LIKE 'open%' You will check the limit of open_files_limit variable with...
  13. K

    What are MySQL triggers? And steps to use them

    MySQL triggers is an object which is attached with particular table and execute when that event occur. These triggers only work when any of these Mysql statements run like INSERT, UPDATE, DELETE etc. NOTE: You can only use triggers if you have MySQL SUPERUSER privileges. So you have your own...
  14. K

    After upgrade Mysql password not working

    We are getting error “Error establishing a database connection” after up gradation to MySQL 5.6.5 or newer version; the reason is new hashing method. Mysql older version used a hashing method to store password but newer version does not support hash method. You have to delete your current user...
  15. K

    Steps to take backup of single Mysql table

    You can follow below steps : You can create dump file : #mysqldump db_name table_name > table_name.sql You can create dump file from remote server: #mysqldump -u <db_username> -h <db_host> -p db_name table_name > table_name.sql You can create dump file using phpmyadmin: Cpanel >>...
  16. K

    How can we rename mysql database in cpanel?

    You can follow below steps to rename mysql database: Login to cpanel. Search for “Mysql Databases” under Databases. Now select particular database which you want to rename from “Current Databases” list and click on “Rename” option. Enter your desired password and click on “Proceed” button. Now...
  17. K

    Steps to check Mysql database size via command

    Login to SSH via root. Now you have to enter below command: mysql -u username –p You will see password prompt you have to enter password of your database. You have to enter below command to display all the databases and also you can see its size in MB. You can use this command to check single...
  18. K

    How can we change Mysql root password via WHM?

    You can follow below steps to change Mysql root password: Login to WHM. Click on Mysql root password under “SQL services” tab. Now you have to enter new password of your Mysql database. You have to use STRONG and COMPLEX password for your database as everyone can access database. Do not use...
  19. K

    Steps to connect Mysql database via Mysql Workbench

    Mysql workbench is an Mysql client tool which helps to connect Mysql database. You can easily connect with mysql database from your computer with this mysql client. Here are the steps to use mysql client: Install mysql workbench and then open it. Click on “New Connection” and you will find...
  20. K

    How can we create Mysql database in DirectAdmin?

    You can follow below steps to create Mysql database. Login to DirectAdmin. Now click on “Mysql Management” link. Here you will find “Create New Database”, you have to click on it. Enter below details : Database Name Database Username Password of that user Re-type Password At last click on...
Top