Posts

Backup and Recovery in MySQL database

1. Create backup for single database.   mysqldump -u root -p pankaj > /home/backup/ramjee.sql; 2. create backup for set utf8 character in single database.   mysqldump -u root -p --default_character_set utf8 pankaj >               /home/backup/ganga.sql 3.create backup for multiple database.    mysqldump -u root -p --databases pankaj sys mysql >   /home/backup/multidatabase.sql 4.create backup for all database. mysqldump -u root -p --all-databases > /home/backup/fulldatabase.sql 5.create backup for single table. mysqldump -u root -p pankaj emp > /home/backup/singletable.sql 6. how to create backup structure only.  mysqldump -u root -p --no-data pankaj emp > structureonly.sql 7.how to backup data only. mysqldump -u root -p --no-create-db --no-create-info pankaj emp > /home/backup/dataonly.sql

MySQL Architecture.

Image

Install mysql on RHEL.7

Linux machine:-RHEL.7 step.1 https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm step .2. yum localinstall mysql80-community-release-el7-1.noarch.rpm step.3. yum install mysql-community-server step.4. Systemctl status mysqld.service. Step.5. Systemctl enable mysqld.service. Step.6. Systemctl status mysqld.service. (Active is need.) Step.7. Mysql_secure_installation. Step. Mysql -u root -p Connect . Thank you.

install MySQL in RHEL 8

Install MySQL RHEL.8 Step.1. Sudo yum update Step.2. sudo yum install @mysql:8.0 step.3. Systemctl status mysqld.service. Step.4 Systemctl enable mysqld.service. Step.5. Restart your linux machine. Step.6. Systemctl status mysqld.service =active. Step.7. Mysql_secure_installation Step.9. Connect Mysql -u root -p password=’please enter your password’.

JOIN IN ORACLE

Image

MYSQL RESET ROOT PASSWORD IN REDHAT

step:1.stop mysql database service. sudo /etc/init.d/mysqld stop step:2.open mysql safe mode use this command     sudo mysqld_safe step:3.   login to root user mysql -u root step:4.use any database . use mysql;  step.5.use this command update user set authentication_string=PASSWORD('mynewpassword') where User='root'; flush privileges; quit step:6.stop mysql database service. sudo /etc/init.d/mysqld stop step:7.start mysql database service sudo /etc/init.d/mysqld start step.8. login to mysql use new password mysql -u root -p