Menu Close

Category: install

MySQL 5.7 auto-generated root password

Hi There. You may have noticed something different when you install a fresh copy of MySQL 5.7 either via yum or using binary source. The root password is auto-generated. Ok and where can I find it ? Centos cat /var/log/mysqld.log | grep “A temporary password is generated for” | awk ‘{print $NF}’ Example: [root@master ~]# cat /var/log/mysqld.log | grep “A temporary password is generated for” | awk ‘{print $NF}’ a3BGf#TY.pBj Binary distribution Once you initialization the datadir mysqld –initialize you will see the bellow log printed on screen: . . . 2016-01-13T21:05:03.070322Z 1 [Note] A temporary password is generated for root@localhost: vL8n>Hs%kr>s . . . You will be required to change the password on the first login. You can do it following step 2 of this article. That’s it. Now . . .

Liked? Help and Share!

MySQL & NoSQL – Memcached Plugin

Many of you have already heard about NoSQL databases and one of the the most used tool is Memcached, where you add a cache layer between the application and database. Since MySQL version 5.6, a new plugin is available to do the integration between MySQL and Memcached. On this article, we will learn how to install it on linux, and some basic configurations of it. Pre-requirements: Install libevent Installation: To install memcached support we will need to create a few tables responsible for MySQL and memcached integration. MySQL already includes the file which creates those tables (innodb_memcached_config.sql), you can find this file in a sub folder of your basedir. To discover where is your basedir, run the bellow command: mysql> SHOW VARIABLES LIKE ‘basedir’; +—————+——-+ | Variable_name | Value | . . .

Liked? Help and Share!

MySQL Fabric – Part 1 – Installing

MySQL Fabric is a tool included on MySQL Utilities that helps you to manage your MySQL instances. It works by basically adding a new layer between your application and MySQL instances, which can provide an easy way to use sharding and build a highly available system. To install our Fabric environment, we will have to configure 4 servers, I will use the follow names and IP on this tutorial: fabric1 (192.168.0.200) – fabric mysql1 (192.168.0.201) – mysql master mysql2 (192.168.0.202) – mysql slave mysql3 (192.168.0.203) – mysql slave Note: I’m running CentOS 6.5 on all servers. 1. Add mysql repo on all 4 machines, please read Installing latest version of MySQL via yum for more info: rpm -i http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm yum update 2. Install mysql mysql-server mysql-utilities: yum install mysql mysql-server . . .

Liked? Help and Share!

MySQL Sandbox

Hi there, today we will learn about an amazing tool that every single MySQL dba must know, I’m talking about MySQL Sandbox. MySQL Sandbox is developed by Giuseppe Maxia (The Data Charmer), it’s a tool that make the installation of MySQL servers very easy. If you need to quickly create a MySQL instance for test or a replication setup(it supports master slave, circular and master master replication), this it the tool. INSTALLATION: Go to http://mysqlsandbox.net/ and get the latest version (I got from launchpad): yum install perl perl-ExtUtils-MakeMaker perl-Test-Simple wget https://launchpad.net/mysql-sandbox/mysql-sandbox-3/mysql-sandbox-3/+download/MySQL-Sandbox-3.0.44.tar.gz tar -zxvf MySQL-Sandbox-3.0.44.tar.gz cd MySQL-Sandbox-3.0.44 perl Makefile.PL make make test make install CREATING A SINGLE SANDBOX: To create a single sandbox, all you need is the mysql package that you want install and the make_sandbox command: [root@localhost ~]# make_sandbox mysql-5.6.17-linux-glibc2.5-i686.tar.gz unpacking /root/mysql-5.6.17-linux-glibc2.5-i686.tar.gz Executing . . .

Liked? Help and Share!

Installing latest version of MySQL via yum

Usually when you try to install MySQL via yum, by default, the version that comes with your OS is always an old version (not the latest version available from mysql.com/downloads). In order to have the latest version, you always needed to go to mysql.com/downloads and manually download and install MySQL packages right? Not anymore, MySQL recently released the MySQL YUM Repository. Basically, it will allows you to install the latest GA version of MySQL Community Server, Workbench and Connector/ODBC. HOW TO INSTALL? You can basically install it in 2 ways: 1. Using the RPM package Download the .rpm from dev.mysql.com/downloads/repo/ and install it: wget http://dev.mysql.com/get/mysql-community-release-el6-3.noarch.rpm/from/http://repo.mysql.com/ sudo yum localinstall -y mysql-community-release-el6-3.noarch.rpm 2. Manually adding a file under /etc/yum.repos.d/ folder Add the bellow content to a new file named mysql-community.repo : [mysql-community] . . .

Liked? Help and Share!

Auditing MySQL With Mcafee Audit Plugin

Audit MySQL isn’t an easy task by default, you can use some technics like tcpdump, write a parser for general log, use MySQL proxy, or you can use some of audit plugins available out there(Mcafee MySQL Audit Plugin or MySQL Enterprise Audit Log Plugin for example). On this post I’ll cover the Mcafee MySQL Audit Plugin (https://github.com/mcafee/mysql-audit), on a follow-up post I’ll talk about MySQL Enterprise Audit Log Plugin. The installation is easy and require just a few steps, I’m using MySQL 5.5 32 bits, so I’ll download the files for my MySQL version and architecture from https://github.com/mcafee/mysql-audit/downloads [root@mysql-audit marcelo]# wget https://github.com/downloads/mcafee/mysql-audit/audit-plugin-mysql-5.5-1.0.3-371-linux-i386.zip [root@mysql-audit marcelo]# unzip audit-plugin-mysql-5.5-1.0.3-371-linux-i386.zip Archive: audit-plugin-mysql-5.5-1.0.3-371-linux-i386.zip creating: audit-plugin-mysql-5.5/ creating: audit-plugin-mysql-5.5/lib/ inflating: audit-plugin-mysql-5.5/lib/libaudit_plugin.so inflating: audit-plugin-mysql-5.5/COPYING inflating: audit-plugin-mysql-5.5/THIRDPARTY.txt inflating: audit-plugin-mysql-5.5/README.txt Next step is to copy the libaudit_plugin.so to MySQL plugin . . .

Liked? Help and Share!

MySQL 5.6 Replication with GTID – Global Transaction ID

Hi guys, Early February Oracle released the new version of MySQL named 5.6, one of the enhancements is the GTID (Global Transaction ID) GTID is an unique identifier which will be added at each transaction, and will be very useful on the slave. remember before we needed to set MASTER_LOG_FILE and MASTER_LOG_POS, now we don’t need them anymore. Let’s see some new variables which we need to add to our cnf file: gtid-mode : It will enable GTID, in order to this function work, we need to turn on log-bin and log-slave-updates enforce-gtid-consistency : It will guarantee that only allowed command will be executed ( more information here) Basicly, is only this what we need to enable GTID, for this tutorial I will use 2 virtual machines, black (master – . . .

Liked? Help and Share!

Installing MySQL 5.5 Part 2 – Multiple instances with mysqld_multi

Continuing our  previous post, today we’ll go up several instances of MySQL on the same server, very common practice today, instead of creating a single instance in100% of the resources of the server splits the load of QPS (queries per seconds) between multiple instances. The groups will look for mysqld_multi [mysqldN] within our my.cnf configuration file, where N is an integer that will be used later to refer to what server we’ll see the STOP or START REPORT We have the following structure on our server: | _3306 / | _data / | _logs / Let’s create the structure of the 3307 instance and set her rights: mkdir 3307 mkdir 3307/data mkdir 3307/logs chown-R mysql: mysql / mysql/3307 We will now create the default structure of the script contained in the database foldermysql cd / mysql / mysql / scripts / . / mysql_install_db – user = mysql – basedir = / mysql / mysql – datadir = /mysql/3307/data / Recalling that we must be careful to get the OK’s 2 below: Installing MySQL system tables … OK Filling help tables … OK That done, we go to our configuration file, the my.cnf, today it looks like this: [mysqld] datadir = / mysql/3306/data socket = / mysql/3306/mysql.sock user = mysql [mysqld_safe] log-error = / mysql/3306/logs/mysqld.log pid-file = / mysql/3306/mysqld.pid Now let’s add a new group, called [mysqld_multi] it will put three items: mysqld – path to our binary mysql, I suggest here, put the path to . . .

Liked? Help and Share!

Installing MySQL 5.5 Part 1 – A single instance

Today I will teach you how to install a MySQL server with ease. With only a single instance in the second part of this article, I will teach installing multiple instances of MySQL and control them through the mysqld_multi. For this tutorial I’m using: VMWare CentOS 5.6 – 64bits 512MB RAM 40GB DISCO Installation without a GUI, only command line That said, let’s get to what really matters: Let’s create a directory structure that we work with our installation of MySQL for this tutorial I will install the root partition: cd / mkdir mysql cd mysql We go to MySQL downlads site and download the latest version Community Server what is now 5.5.11. Use Build Linux Generhttp://twitter.com/#!/altmannmarceloic and search for the package tar.gz version of its operating system: wget http://mysql.cce.usp.br/Downloads/MySQL-5.5/mysql-5.5.11-linux2.6-x86_64.tar.gz . . .

Liked? Help and Share!

lost MySQL root password

If you have lost the MySQL root password, or just don’t remember it, don’t worry, follow the step by step for you to retrieve it Stop the MySQL service if it is running “/etc/init.d/mysql stop” Up the Server “skiping” the layer responsible for checking the user privileges mysqld_safe-skip-grant-tables , remembering , when you start the server with this option, it will accept any user to connect to database MySQL database with full access to all the databases, then to inhibit other people from connecting to the server during the maintenance period, I suggest you use the following command to start the server  mysqld_safe – skip-grant-tables – skip-networking. In this case the server not accept connections over TCP/IP Connect to server with the command mysql -u anything Enter update mysql.user set . . .

Liked? Help and Share!