Category: My SQL

  • SQL Interview Questions

    You can benefit from this article’s popular SQL Server DBA interview questions and answers. To learn more about SQL interview questions, I would advise you to read this post as well as the SQL Server Interview questions and answers. I made an effort to be very specific in my responses to each question in this…

  • Index in MySQL

    Index Info… SELECT DISTINCT     TABLE_NAME, INDEX_NAME,COLUMN_NAME, index_type FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA =’thinklouder_optimization’; SHOW INDEXES FROM table_name IN database_name; —————————————————— OPTIMIZE TABLE tbl;  will rebuild the indexes and do ANALYZE; it takes time. —————————————————— ANALYZE TABLE tbl;  is fast for InnoDB to rebuild the stats. With 5.6.6 it is even less needed. —————————————————— Read the…

  • Read a big file using PowerShell

    # Command-Format: Get-Content ‘your-file-path’ -Tail <number-of-line>Get-Content ‘.\mylargefile.txt’ -Tail 5000 # Get-Content D:\MyBigFeedFile.txt | Select-Object -skip 123798766555672 -first 6

  • Win OS Related Quick Commands

     Find Who Restarted Windows Server –Run the following command to filter the System Logs with Source as User32. Get-EventLog -LogName System | Where Source -eq User32 –You may also filter the system logs with Event ID 1074 with the following command. Get-EventLog -LogName System | Where EventID -eq 1074

  • MySQL DBA Hand Book

    Connect MySQL DB:  mysql> mysql -u root  –socket=/var/lib/mysql/mysql.sock -p Enter password:_ Check Running Process List: mysql> show full processlist \G Create User:  mysql> create user ‘account_name’@’Ip_address or %’ IDENTIFIED BY ‘**********’; Alter a User:  mysql> alter user ‘root’@’localhost’ identified by ‘Secure@123’; Grant Privilege’s to the Mysql User:  mysql> grant all privileges on *.* to account_name; mysql> flush privileges; mysql> grant create, select, insert on *…

  • My SQL Innodb Cluster Setup

    Server List clota-dbl05  @@version 8.0.32-commercial 192.168.0.156 My SQL root password Secure@123 ——————————————————————- ota-dbl06 <cota-dbl06> @@version 8.0.33 192.168.0.197 My SQL root password Secure@123 ——————————————————————- clota-dbl07 192.168.0.195 @@version @@version 8.0.33 My SQL root password Secure@321 ——————————————————————- Step 1: Modify /etc/hosts with IP and server_name  on all the nodes… Like below  vim /etc/hosts 192.168.0.156   clota-dbl05 192.168.0.197      ota-dbl06 192.168.0.195   clota-dbl07…

  • Install MySQL 8 on Oracle Linux

    Installing MySQL on Oracle Linux is simple and straightforward. Download the latest version of MySQL based on your OS version. Download via Command Line (optional): Use wget or curl to download the file directly if you prefer using the command line wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz Change to the directory where you downloaded the tarfile: cd  /test Extract…

  • Mysql Replication

    MySQL database servers (slave)- I/O thread and SQL Thread- Replication I/O threads-  When a start slave statement is issued on a replica server, the replica creates an I/O thread, which connects to the source and asks it to send the updates recorded in its binary logs. The replication I/O thread reads the updates that the…