• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mysql

How can I get Excel data into MySQL, or vice versa?

by admin

Excel and MySQL can read and write delimited text (CSV) files. To load a text file into MySQL, use the LOAD DATA INFILE statement. To create a text file from MySQL, use the SELECT INTO OUTFILE syntax, or the ability of the client to write or redirect to a file. For example: $ mysql -e […]

Filed Under: MariaDB, mysql

How to use mysqldump without CREATE TABLE statements

by admin

mysqldump is a utility program used for making a logical backup by generating a set of SQL statements that can be executed to reproduce the original database table data and object definition. It dumps one or more database for backup or may transfer to another SQL server. It can also generate data output in different […]

Filed Under: MariaDB, mysql

How to Use External Python modules in MySQL Shell

by admin

MySQL Shell is a great tool for working with MySQL. One of the features that make it stand out compared to the traditional mysql command-line client is the support for JavaScript and Python in addition to SQL statements. This allows you to write code you otherwise would have had to write outside the client. This […]

Filed Under: DevOps, mysql, Python

Configure MySQL Router to Auto Restart of Failure using systemd

by admin

The systemd unit file that ships with the MySQL Router 8.0 RPM’s will not automatically restart mysqlrouter on failure. It can be modifed to do so, though, by editing the file /usr/lib/systemd/system/mysqlrouter.service and adding this line: Restart=on-failure Put it right after the “ExecStart” line, so that the file ooks like this: [Unit] Description=MySQL Router After=syslog.target […]

Filed Under: CentOS/RHEL, CentOS/RHEL 7, CentOS/RHEL 8, Linux, mysql

How to change the audit log path in the MySQL Docker

by admin

1. Here we use 5.7.29 Docker image as an example. $ docker load -i mysql-enterprise-server-5.7.29.tar 2. You can bind OS mounts to Docker directory, assume you want to keep the audit logs under /bak/logs directory on the host. $ docker run –name=mysql1 \ –mount type=bind,src=/bak/my.cnf,dst=/etc/my.cnf \ –mount type=bind,src=/bak/data,dst=/var/lib/mysql \ –mount type=bind,src=/bak/logs,dst=/var/lib/logs \ -d mysql/enterprise-server:5.7 3. […]

Filed Under: DevOps, Docker, mysql

How to use mysqlsh to execute addInstance in silent mode

by admin

Question: How to use mysqlsh to execute addInstance in silent mode (from a script) and avoid answering such a question? cl.addInstance(‘[USER]@[HOST]:[PORT]’) Please pick an option out of [C]lone/[I]ncremental recover/[A]bort (default Clone): Adding an instance to InnoDB Cluster requires the specification of what kind of recovery is desired. This can be of two types (incremental or […]

Filed Under: mysql

How to take Logical Backups on a MySQL Replication Slave using shell script

by admin

The sample script in this post uses the bash shell. It is also assumed that MySQL has been installed and the slave has been initialized. For MySQL 5.7 and later, the script only works for single-source replication. The server to be backed up should be configured as a slave. If you have one or more […]

Filed Under: mysql, MySQL Cluster

MySQL Cluster requirements to avoid Single Point of Failure

by admin

In this post, we will discuss the minimum requirements to have no single point of failure for all services in a MySQL Cluster setup. To remove all single points of failure there are the following requirements to the Cluster configuration: There must be two copies of the data To allow API and data nodes to […]

Filed Under: mysql, MySQL Cluster

What is an Arbitrator in MySQL Cluster

by admin

If one or more nodes in a cluster fail, it is possible that not all cluster nodes will not be able to “see” one another. In fact, it is possible that two sets of nodes might become isolated from one another in a network partitioning, also known as a “split brain” scenario. This type of […]

Filed Under: mysql, MySQL Cluster

How To Install MySQL RPM packages in a different location to allow multiple versions (versions < 5.6.10)

by admin

Question: How to install the MySQL RPM packages in a different location to allow multiple versions and/or avoid compromising your existing installation? Note that it is generally not recommended to install the RPM package of MySQL in a different location. Install the RPM package(s) You can use the –relocate option for the rpm command to […]

Filed Under: mysql

Next Page »

Primary Sidebar

Recent Posts

  • qsub Command Examples in Linux
  • qsub: command not found
  • qrcp Command Examples in Linux
  • qmrestore Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright