Installing Veeam Backup for VMWare

Installing Veeam Backup for VMWare

This is a “From Scratch” implementation of Veeam backup & Replication 8.0 for VMWare.

I’ll be installing B&R (Backup & Replication) on a VM on the target server, which is running EXSi 5.5, and installing the Enterprise Management Console on a workstation.

Download Veeam B&R from Veeam’s website. You’ll have to register, and make sure you use an email address that isn’t public (e.g. gmail,yahoo, etc.) or you won’t get access to the things you’ll need. Get the B&R ISO, the license file, and the latest patch.

Check the release notes for system requirements. Here’s a helpful Installation Guide on Veeams Help Center:

http://helpcenter.veeam.com/backup/80/vsphere/index.html?install_vbr_1.html

Hardware requirements are: at least 2 cores 4GB RAM MINIMUM.

My VM has:

2 cores

8GB RAM

100GB Hard Drive NOTE: the fully set up machine came to 38GB.

I’m installing on a Windows 7 Pro VM and found that I needed Service Pack 1,Powershell 2.0, and Internet Explorer 9 or higher. These aren’t included in the Veeam installation package. I’ve also downloaded and installed Microsoft Security Essentials.

The filenames for these updates are:

Windows6.1-KB2819745-x64-MultiPkg.exe, IE11-Windows6.1-x64-en-us.exe, and windows6.1-KB976932-X64.exe

After meeting all of the prerequisites I began the installation. choosing the default settings and letting the installation add the required software bundled with it.

Install any patches issued by veeam.

 

Setting up Nagios monitoring on Windows 2003r2 through a Firewall

Setting up Nagios monitoring on Windows 2003r2 through a Firewall

Download nrpe_nt, currently nrpe_nt.0.8b-bin.zip

Extract to the root of c: on the Target Windows Machine.

You should have a directory called c:nrpe, that contains a sub-directory called bin.

Download the plugins, currently nrpe_nt_plugins.zip.

Unzip this file and place the executables in a directory called c:nrpepluginsbin

Change to the c:nrpebin directory, edit the nrpe.cfg file to look like this:

server_port=<port# you'll use for this particular Target Machine> 
server_address=<This Target Machine's IP Address>
allowed_hosts=<The IP Address of your Nagios Server>
debug=1
command_timeout=30
loglevel=7
command[check_cmd]=C:nrpebintest.cmd
command[check_cpuload]=C:nrpepluginsbincpuload_nrpe_nt.exe 70 90
command[check_disk_c]=C:nrpepluginsbindiskspace_nrpe_nt.exe c: 70 90
command[check_disk_d]=C:nrpepluginsbindiskspace_nrpe_nt.exe d: 70 90
command[check_disk_e]=C:nrpepluginsbindiskspace_nrpe_nt.exe e: 70 90
command[check_memload]=C:nrpepluginsbinmemload_nrpe_nt.exe 70 90

open a command prompt, and:

	cdnrpebin
	        nrpe_nt -i

You should get a confirmation that the service was created successfully.


Go to Administrative Tools > Services and start the service

You can test that the client is listening on the designated port on the Windows Target Machine:

	netstat -aon | findstr <port#>

Test the connection from the CLI at the nagios server:

	/usr/lib/nagios/plugins/check_nrpe -H <IP of the Firewall> -p 1248 MEMUSE -p 	<port# defined in the firewall and configured in nrpe.cfg on the target>

On the Nagios Server, in the /etc/nagios3/conf.d/check_nrpe.cfg file, define a command that will use the -p switch to allow for a port # argument:

	define command {
        	command_name    check_nrpe_port
        	command_line    /usr/lib/nagios/plugins/check_nrpe -t20 -H $HOSTADDRESS$ -c $ARG1$ -p $ARG2$
}


-c = The command executable on the Target Machine in c:nrpepluginsbin
-p = the port #


In the /etc/nagios3/conf.d/hosts_orig.cfg file, create your host using the ip address of the firewall.

define host{
       use                  	         test-host
       host_name           	 test-dc1
       alias                  	         test-dc1
       address             	        <IP Address of the Gateway>



In the /etc/nagios3/conf.d/services.cfg file, create the services for your host using the host_name defined above and the command name you created with arguments. Set your port number for this Target Machine here, making sure the port# matches the Target Machine where you defined that port#.

define service{
    use                                             test-template
    host_name                                 test-dc1
    service_description                    disk C:
    check_command                       check_nrpe_port!check_disk_c!5667
}
define service{
    use                                            test-template
    host_name                                test-dc1
    service_description                   CPU load
    check_command                       check_nrpe_port!check_cpuload!5667
}
define service{
    use                                             test-template
    host_name                                 test-dc1
    service_description                    memory load
    check_command                       check_nrpe_port!check_memload!5667
}

Reload nagios and check for errors.

Service nagios3 reload

At the firewall:

Note: This example is using a Safe@Office 500P firewall, so the terminology may be different.

You will need to create a service using tcp protocol and corresponding to each nrpe port number that you'll be using. In this case, I'm using 5666 through 5671. In my case, these settings were under Network > Services in the 500P configuration web interface.

Create a new network object for the Nagios Server using its IP Address

You'll need network objects for the Target Machines that you'll be monitoring. 


Create “allow and Forward” rules for each of your Target Machines using the service for the port # you assigned to that Target Machine:

Service = Standard Service, The service w/correct port for you Target machine
Source = Your Nagios Server
Destination = “This Gateway”
Forward to = Target Machine

Continue by configuring your Nagios Server to monitor these new Targets.

When defining the host in the hosts.cfg file for Nagios, use the firewall's gateway IP Address 

Matt Long
02/05/2015

Adding and Removing Local Storage From XenServer

Adding and Removing Local Storage From XenServer

To add local storage XenServer 6.x

get your device id’s with:

ll /dev/disk/by-id

The host uuid can be copied and pasted from the general tab of your host in XenCenter.

Create your storage:

xe sr-create content-type=user device-config:device=/dev/sdb host-uuid=<Place the host’s UUID here> name-label=”<Name your local storage here>” shared=false type=lvm

NOTE: Make sure that “shared=” is false. If you have shared storage on a hypervisor, you won’t be able to add it to a pool. When a hypervisor is added to a pool, its local storage is automatically shared in that pool.

NOTE: Replace sdb in the above command with the device that you’re adding.

To Remove local storage XenServer 6.x

Go to console in XenCenter or log in to your xenserver host via ssh

List your storage repositories.

xe sr-list

You will see something like this:

uuid ( RO) : <The uuid number you want is here>
name-label ( RW): Local storage
name-description ( RW):
host ( RO): host.example.com
type ( RO): lvm
content-type ( RO): user

uuid string is the Storage Repository uuid (SR-uuid) that you need to be able to do the next step.

Get the Physical Block Device UUID.

xe pbd-list sr-uuid=Your-UUID

uuid ( RO) This is the PBD-uuid

Unplug the local storage.

xe pbd-unplug uuid=Your-PBD-uuid

Delete the PBD:

xe pbd-destroy uuid=your-PBD-uuid

Forget ( remove ) the Local storage from showing up as detached.

xe sr-forget uuid=your-SR-uuid

Now check your XenCenter that it’s removed.

Error While Installing PGAdmin v1.20.0 for Windows

Error While Installing PGAdmin v1.20.0 for Windows

go to:

http://www.pgadmin.org/download/windows.php

Download the latest version. At the time of this post it was v1.20.0.

Unzip the file and run the .msi file.

I encountered an error after the installation when running the program to the affect of:

MSVCP120.dll is missing

This file relates to Microsoft Visual C++. The redistributable package can be found here:

http://www.microsoft.com/en-us/download/details.aspx?id=40784

After downloading and installing the x64 package (I’m running Win7 x64), I still encountered the error.

This problem was resolved by downloading and installing the x86 package.

Matt Long
1/22/2015

 

Configuring Bind9

Configuring Bind9

This doc will show how to create the conf files for and test bind9.

Configuration files are located at /etc/bind

Become root

Create a sub-directory to store the conf files. In this doc, it will be “zones”

cd /etc/bind/
mkdir zones

Copy the default conf file that you’ll use to zones

cp db.local ./zones/example.com.db.local

Where example.com is your domain

Edit this file

cd zones
nano example.com.db.local

 

The file should appear as follows:

;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
@ IN A 127.0.0.1
@ IN AAAA ::1

make the changes to the file to appear as this:

NOTE: Don’t forget the periods after the domain names

xxx.xxx.xxx.xxx = the target machines’ IP Address

;
; BIND data file for local loopback interface
;

$TTL 604800

@ IN SOA example.com. host.example.com. (

2 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS ns1.example.com.

@ IN A xxx.xxx.xxx.xxx

@ IN AAAA ::1

;

ns1 IN A xxx.xxx.xxx.xxx

mail IN A xxx.xxx.xxx.xxx

www IN A xxx.xxx.xxx.xxx
;

example.com. IN MX 10 mail.example.com.

;

Computer-Name IN CNAME www

These changes will create “A” records for ns1, (which is your dns server), and also mail and www.
It further creates an MX or Mail Exchange record for mail.example.com.
It creates an alias, or “CNAME” for “Computer-Name”.

Rules to remember:
a ; is used to uncomment. # doesn’t work here.
in-addr.your MX record must have a corresponding “A” Record. It can’t be a CNAME.

Now, create a file in your zones directory titled example.com.in-addr.arpa.local. This is for reverse lookups.

Edit the file to look like this:

$TTL 604800

@ IN SOA example.com. root.example.com. (

2010081401;

28800;
604800;

604800;
86400 );
;
IN NS ns1.example.com.

4 IN PTR example.com.

Edit the file /etc/bind/named.conf.local

This is where you’ll point the bind service to the files that you created in the zones directory

Make the file look like this:

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include “/etc/bind/zones.rfc1918”;
zone “example.com” { NOTE: THIS DOMAINNAME ENTRY IS, IN FACT, IN QUOTES
type master;
file “/etc/bind/zones/example.com.db.local”;
};

zone “3.2.1.in-addr.arpa” {
type master;
file “/etc/bind/zones/example.com.in-addr.arpa.local”;
};

As you can see in the example above, The “file” statements correspond with the path and filenames you created.

Restart the service:
service bind9 restart

To test:
Look at the syslong file
grep bind /var/log/syslog

It should look something like this:

Jan 26 15:54:13 mtxfarm-matt-test named[4602]: starting BIND 9.8.1-P1 -u bind
Jan 26 15:54:13 mtxfarm-matt-test named[4602]: built with ‘–prefix=/usr’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–sysconfdir=/etc/bind’ ‘–localstatedir=/var’ ‘–enable-threads’ ‘–enable-largefile’ ‘–with-libtool’ ‘–enable-shared’ ‘–enable-static’ ‘–with-openssl=/usr’ ‘–with-gssapi=/usr’ ‘–with-gnu-ld’ ‘–with-geoip=/usr’ ‘–enable-ipv6’ ‘CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2’ ‘LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro’ ‘CPPFLAGS=-D_FORTIFY_SOURCE=2’
Jan 26 15:54:13 mtxfarm-matt-test named[4602]: loading configuration from ‘/etc/bind/named.conf’
Jan 26 15:54:13 mtxfarm-matt-test named[4602]: reading built-in trusted keys from file ‘/etc/bind/bind.keys’
Jan 26 15:54:13 mtxfarm-matt-test named[4602]: set up managed keys zone for view _default, file ‘managed-keys.bind’

Look for errors or warnings

Use the command “dig” using one of the FQDN’s that you defined in you example.com.db.local file:
dig mail.example.com @xxx.xxx.xxx.xxx

in place of xxx.xxx.xxx.xxx, use your new dns server’s ip address.

You should see this:

; <<>> DiG 9.8.1-P1 <<>> mail.test-matt.com @206.207.94.34
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48761
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;example.com. IN A

;; ANSWER SECTION:
mail.example.com. 604800 IN A xxx.xxx.xxx.xxx

;; AUTHORITY SECTION:
example.com. 604800 IN NS ns1.example.com.

;; ADDITIONAL SECTION:
ns1.example.com. 604800 IN A xxx.xxx.xxx.xxx

;; Query time: 1 msec
;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx)
;; WHEN: Mon Jan 26 16:02:52 2015
;; MSG SIZE rcvd: 86

add an “mx” to the end of that dig command and use just the domain name (example.com) to test your mx record.

dig example.com @xxx.xxx.xxx.xxx mx

It should look like this:

; <<>> DiG 9.8.1-P1 <<>> mail.test-matt.com @206.207.94.34 mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26489
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.example.com. IN MX

;; ANSWER SECTION:
example.com. 604800 IN MX 10 mail.example.com.

;; AUTHORITY SECTION:
example.com. 604800 IN NS ns1.example.com.

;; ADDITIONAL SECTION:
mail.example.com. 604800 IN A xxx.xxx.xxx.xxx
ns1.example.com. 604800 IN A xxx.xxx.xxx.xxx

;; Query time: 1 msec
;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx)
;; WHEN: Mon Jan 26 16:06:10 2015
;; MSG SIZE rcvd: 77

Matt Long
01/26/2015

Automating patch installation on XenServer

Automating patch installation on XenServer

I have four instances of freshly installed XenServer 6.2 and there are about a dozen patches for each that need to be applied. Herein, I will attempt to somewhat automated the application of these patches.

What you will need to know:

The list of patches required

The URLs of the download pages for each patch to be applied

The UUID of the patch

The UUID of the Target Host. This can be found by doing, on the console,

a:

xe host-list

The procedure is as follows:

Use the wget command to download the patch. I’ll use Service Pack 1 as an example. We want that patch first, as it is cumulative, and will cut down the number of other patches to be installed.

To find the URL where SP1 resides. go to XenCenter Console, Tools, Check for Updates. This will give you a list of patches available for your server, with links to the download location. Click on the link for XS62ESP1. On the web page that opens, click on “Download”. This will open another page. This is the URL that you want. Copy it to clipboard.

You’ll need the urls and filenames for all the applicable patches when you customize your script.

 

http://downloadns.citrix.com.edgesuite.net/8707/XS62ESP1.zip

Now initiate the wget command at the console in XenCenter using this URL:

wget http://downloadns.citrix.com.edgesuite.net/8707/XS62ESP1.zip              NOTE:Case Sensitive!

Then unzip it:

unzip XS62ESP1.zip

This zip file contains a file ending with the extension “xsupdate” as in “XS62ESP1.xsupdate. That’s our patch

Register the patch on the Target Server:

xe patch-upload file-name=XS62ESP1.xsupdate

This will display the uuid of the patch. We’ll need that for the next command. You can call it up again with:

xe patch-list

Install the patch:

xe patch-apply uuid=<The patch uuid from th xe patch-list command> host-uuid=<The host uuid from the xe host-list command>

Due to limited disk space, we’re going to clean out our working directory:

rm *

Now we’ll write our script: Notice that we’re doing the upload/registration and apply in one command.

Start of Script:

wget http://downloadns.citrix.com.edgesuite.net/8707/XS62ESP1.zip

unzip XS62ESP1.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/8737/XS62ESP1002.zip

unzip XS62ESP1002.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1002.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/9058/XS62ESP1005.zip

unzip XS62ESP1005.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1005.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/9491/XS62ESP1008.zip

unzip XS62ESP1008.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1008.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/9617/XS62ESP1009.zip

unzip XS62ESP1009.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1009.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/9698/XS62ESP1011.zip

unzip XS62ESP1011.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1011.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/9703/XS62ESP1013.zip

unzip XS62ESP1013.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1013.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/9708/XS62ESP1014.zip

unzip XS62ESP1014.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1014.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/10128/XS62ESP1015.zip

unzip XS62ESP1015.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1015.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/10134/XS62ESP1012.zip

unzip XS62ESP1012.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1012.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

wget http://downloadns.citrix.com.edgesuite.net/10174/XS62ESP1016.zip

unzip XS62ESP1016.zip

xe patch-apply uuid=`xe patch-upload file-name=XS62ESP1016.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *

Now just copy the text you created with your patches listed in place of mine and paste in to to the console. You’ll be off and running! (Go get Coffee)

Matt Long

02/17/2015

Connecting to a database with PHP

Connecting to a database with PHP

Install these packages:

#apt-get install apache2
#apt-get install mysql
#apt-get install php
#apt-get install php5-mysql

Create a test user, password and database

At the sql server, Log into mysql:

#mysql -u root -p

Issue the following commands to create a user “test” and a password “password”:

CREATE USER ‘test’@’localhost’ IDENTIFIED BY ‘password’;
CREATE USER ‘test’@’%’ IDENTIFIED BY ‘password’;

GRANT ALL ON *.* TO ‘test’@’localhost’;
GRANT ALL ON *.* TO ‘test’@’%’;

CREATE DATABASE instruments

 

Exit mysql:

q

Log back in as the user you just created, attaching to the new database:

mysql -u test -p instruments

Execute a

s

to see the status. Verify the user and database.

Test PHP Functionality:

Create a file named “something”.php and insert the following text:

<?php echo ‘hello world’.time();
/* <?php echo ‘mysqli_connect(); print_r(mysqli_query(‘select now()’)) ; ?> */
?>

Place this file in the /var/www directory

Open a browser and point to that file:

http://<your server>”something”.php

You should see hello world and the date.

To test your connection to the database via PHP:

Create a file with the following text and name it “something”.php

Edit the line “$db = mysql_connect(“206.207.94.34″,”test”,”password”);” to reflect your server & user.

<?php
$db = mysql_connect(“206.207.94.34″,”test”,”password”);
if (!$db) {
die(“Database connection failed miserably: ” . mysql_error());
}
else

die(“Database Success!!!: ” . mysql_error());
$db_select = mysql_select_db(“instruments”,$db);
if (!$db_select) {
die(“Database selection also failed miserably: ” . mysql_error());
}
?>
<html>
<head>
<title>Step 3</title>
</head>
<body>
<?php
$result = mysql_query(“SELECT * FROM mytable”, $db);
if (!$result) {
die(“Database query failed: ” . mysql_error());
}
?>
</body>
</html>

Place this file in the /var/www directory

Open a browser and point to that file:

http://<your server>”something.php

Success!!!

HANDY MYSQL COMMANDS:

Note that all text commands must be first on line and end with ‘;’
? (?) Synonym for `help’.
clear (c) Clear the current input statement.
connect (r) Reconnect to the server. Optional arguments are db and host.
delimiter (d) Set statement delimiter.
edit (e) Edit command with $EDITOR.
ego (G) Send command to mysql server, display result vertically.
exit (q) Exit mysql. Same as quit.
go (g) Send command to mysql server.
help (h) Display this help.
nopager (n) Disable pager, print to stdout.
notee (t) Don’t write into outfile.
pager (P) Set PAGER [to_pager]. Print the query results via PAGER.
print (p) Print current command.
prompt (R) Change your mysql prompt.
quit (q) Quit mysql.
rehash (#) Rebuild completion hash.
source (.) Execute an SQL script file. Takes a file name as an argument.
status (s) Get status information from the server.
system (!) Execute a system shell command.
tee (T) Set outfile [to_outfile]. Append everything into given outfile.
use (u) Use another database. Takes database name as argument.
charset (C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings (W) Show warnings after every statement.
nowarning (w) Don’t show warnings after every statement.

For server side help, type ‘help contents’

Matt Long
01/27/2015

Getting Started with Mysql and Heidi SQL

Getting Started with Mysql and Heidi SQL

At the target server prompt, become root and type:

apt-get install mysql-server

provide a a password for the root mysql user

Verify that mysql is running:

netstat -tap | grep mysql

you should see something like this:

tcp 0 0 localhost:mysql *:* LISTEN 21921/mysqld

Verify that you can log in:

mysql -u root -p

 

You should be prompted for the root password and your prompt should change to:

mysql>

Type “help” or “?” to review the commands.

Type to exit:

q

To configure Mysql for remote connections edit /etc/mysql/my.cnf

Verify the port number. The default is 3306
Set the bind-address to 0.0.0.0

Log in to mysql as above and execute the following commands.

CREATE USER ‘myuser’@’localhost’ IDENTIFIED BY ‘mypass’;
CREATE USER ‘myuser’@’%’ IDENTIFIED BY ‘mypass’;

GRANT ALL ON *.* TO ‘myuser’@’localhost’;
GRANT ALL ON *.* TO ‘myuser’@’%’;

Note: the ‘localhost’ and ‘%’ are the correct syntax. Only change myuser and mypass.

q

Restart mysql:

/etc/init.d/mysql restart

You should be able to install Heidi SQL and log in now.

Matt
01/23/2015

Configuring PostgreSQL for access with PGAdmin

Configuring PostgreSQL for access with PGAdmin

Download and install PGAdmin on your workstation.

At the postgresql server that you want to connect to, the configuration files for PostgreSQL are stored in:

     /etc/postgresql//main

Edit the postgesql.conf file, uncomment the line and add the server’s ip address:

listen_addresses = ‘ip_address’
     ssl = true
     ssl_ciphers = ALL
     password_encryption = on

You can also change the default port number here with the line:

port = 5432

Make note of the port number that you use.

 

edit the pq_hba.conf file and include a line:

host all all 192.168.1.0/24 md5

substitute the ip address for whatever your local network uses.

If your login in PGAdmin fails, the error message may report a different ip address than what is defined in your workstation.
use the reported ip address in the pg_hba.conf file.

After making changes to the postgrsql.conf file, restart the database server:

/etc/init.d/postgresql restart

PGAdmin should now be able to open a connection to your database server. Log in with your postgresql username and password.

Matt 01/23/2015

Call Now Button(208) 344-1115

SIGN UP TO
GET OUR 
FREE
 APP BLUEPRINT

Join our email list

and get your free whitepaper