RSS News Sources
MySQL connection very slow after server switch (2 replies)
Since neither #1 nor #2 is connected to a backup server, we moved the db to a smoking fast Windows 2008 Enterprise server with the same version of MySQL. That server hosts several IIS apppools for ASP pages and hosts ColdFusion pages, but this MySQL db is so small and simple in comparison, it can't be suffering. The robot manufacturer did the db migration, had to make some changes to their code, and everything works fine. The software config on each machine is the same.
The problem is when #1 interacts with the db, an operation that took <1s is now taking 3-4s while it waits for a response from the db. I did pings to the MySQL server as well as other servers from each machine and there is no difference in network connectivity. I have tried running #1 while #2 is shutdown and there is no improvement in speed. I have also changed the db connection to use the IP address instead of DNS name with no improvement.
I'm no dba and no IT guy--I'm the scientist end user. None of the admins (dba, IT admins, or company men) know what could be wrong so I put it out to ya'll. What do you think is going on?
Thanks,
Paul
Unable to resolve fatal error: (no replies)
I am trying to connect to my MYSQL database via php, I have used this code to do that, but I get a fatal error:
//connect to a single database
$con=mysqli_connect("localhost", "root", "1234", "SIGN-TECH");
//check connection
if (mysqli_connect_err($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?
Fatal error: Call to undefined function mysqli_correct_err() in C:\Apache24\htdocs\mysql_connect2.php on line 7
When I look at my php info I have this enabled, I read elsewhere to check to make sure of this and it is enabled:
mcrypt support enabled
mcrypt_filter support enabled
Version 2.5.8
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes arcfour
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream
Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value
Unable to resolve fatal error: (no replies)
I am trying to connect to my MYSQL database via php, I have used this code to do that, but I get a fatal error:
//connect to a single database
$con=mysqli_connect("localhost", "root", "1234", "SIGN-TECH");
//check connection
if (mysqli_connect_err($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?
Fatal error: Call to undefined function mysqli_correct_err() in C:\Apache24\htdocs\mysql_connect2.php on line 7
When I look at my php info I have this enabled, I read elsewhere to check to make sure of this and it is enabled:
mcrypt support enabled
mcrypt_filter support enabled
Version 2.5.8
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes arcfour
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream
Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value
Holland Backup Manager
Part 1 - Installing Holland Backup ManagerI spoke at Percona Live Conference and Expo 2013 about backups. Part of the talk focussed on the backup products in the ecosystem that will help you make a backup of your MySQL data. This follow-up article touches on one of the frameworks from my talk, the Holland Backup Manager. I was able to have a chat with some of the guys on the Rackspace booth about Holland and had some questions regarding features answered.
Holland is a backup framework focussing mostly on MySQL backups but it is pluggable so you can write add backup providers to extend it to your own needs. Using the framework you're able to configure and deploy backup jobs of varying scope to multiple machines. The framework which was originally developed at Rackspace, currently supports mysqldump, lvm, xtrabackup and pgdump (Postgres) also sqllite. The latest version is number 1.0.8 which brings a few nice new features with it. I'll talk about the most significant of these in the third of the series.
I want to show some installation, configuration and then use of the framework. I'm a fan of this project and if you've got the need to standardise whilst being flexible then Holland could be the solution you've been looking for.
Firstly, head over to github to grab the files. https://github.com/holland-backup/holland
I've been using vagrant to provide a quick VM environment. This OS I'm using here is a CentOS 6.4 64bit host running in Virtualbox. All dependencies for Holland should be available on the popular package managers but if you're using something other then debian (apt-get) or redhat based (yum) then you might require some research elsewhere to meet the requirements of Holland.
Download the zip archive from github (the extension was lost in wget but it is a .zip file)
[vagrant@node1 ~]$ wget https://github.com/holland-backup/holland/archive/master.zip ... Saving to: `master' 100%[==================================================>] 602,186 572K/s in 1.0s (572 KB/s) - `master' saved [602186/602186]
So then proceed to unzip your archive
[vagrant@node1 ~]$ unzip ./master
Archive: ./master
832eaa6a0fff56a3009cdde22eda4746203c97f6
creating: holland-master/
inflating: holland-master/CHANGES.txt
inflating: holland-master/INSTALL
inflating: holland-master/LICENSE
inflating: holland-master/README
creating: holland-master/config/
inflating: holland-master/config/README
...
ProTip: Take some time to go through the various Holland directories. Throughout the directories there README and INSTALL files that will explain more about the accompanying files.
[vagrant@node1 holland-master]$ ls -l
total 56
-rw-rw-r-- 1 vagrant vagrant 7064 May 13 17:45 CHANGES.txt
drwxrwxr-x 4 vagrant vagrant 4096 May 13 17:45 config
drwxrwxr-x 3 vagrant vagrant 4096 May 13 17:45 contrib
drwxrwxr-x 4 vagrant vagrant 4096 May 13 17:45 docs
drwxrwxr-x 7 vagrant vagrant 4096 May 13 17:45 holland
-rw-rw-r-- 1 vagrant vagrant 1782 May 13 17:45 INSTALL
-rw-rw-r-- 1 vagrant vagrant 3290 May 13 17:45 LICENSE
drwxrwxr-x 13 vagrant vagrant 4096 May 13 17:45 plugins
-rw-rw-r-- 1 vagrant vagrant 514 May 13 17:45 README
-rw-rw-r-- 1 vagrant vagrant 62 May 13 17:45 setup.cfg
-rw-rw-r-- 1 vagrant vagrant 1441 May 13 17:45 setup.py
drwxrwxr-x 2 vagrant vagrant 4096 May 13 17:45 tests
-rwxr-xr-x 1 vagrant vagrant 1782 May 13 17:45 tomsay.py
Before going any further lets take care of the dependencies. They're easily met using yum/apt or if you want to compile them yourself then go right ahead;
  - python-setuptools
  - mysqldb (python's mysql connector)
Now, lets take care of some directories that need to exists. These are configurable later, but for simplicity sake we'll roll forward with the Holland defaults. Your environment is likely to be different especially if you're mounting remote storage to store the backup files you make.
[vagrant@node1 config]$ sudo mkdir -p /etc/holland [vagrant@node1 plugins]$ sudo mkdir -p /var/log/holland [vagrant@node1 plugins]$ sudo mkdir -p /var/spool/holland
Now the directories we've created will only be writable to root since we needed elevated privileges to make them. You might choose to chmod the directories if you're going to use a specific backup user to run your backup jobs. Now we're ready to run the python setup file from the root of the unarchived directory [vagrant@node1 holland-master]$ sudo python ./setup.py install
running install
running bdist_egg
running egg_info
creating holland.egg-info
writing holland.egg-info/PKG-INFO
...
Installing holland script to /usr/bin
Installed /usr/lib/python2.6/site-packages/holland-1.0.8-py2.6.egg
Processing dependencies for holland==1.0.8
Finished processing dependencies for holland==1.0.8
Without any errors in the previous output it's safe to assume we're installed. [vagrant@node1 config]$ holland --version
Holland Backup v1.0.8
Copyright (c) 2008-2010 Rackspace US, Inc.
More info available at http://hollandbackup.org
Lets review what is in the plugin directory. These are the providers. Some are core libraries for the use of particular providers. There's also an example and random directory which we will reference in the next article on config.
[vagrant@node1 plugins]$ ls -w1
ACTIVE
holland.backup.example
holland.backup.mysqldump
holland.backup.mysqlhotcopy
holland.backup.mysql_lvm
holland.backup.pgdump
holland.backup.random
holland.backup.sqlite
holland.backup.xtrabackup
holland.lib.common
holland.lib.lvm
holland.lib.mysql
README
There are a couple of essential installs we need to take care of before we're ready to tackle the plugins for the backup tools. These are the holland.lib.common & holland.lib.mysql. For each you need to run the setup.py file from within the directories. The output should look something like the following.
[vagrant@node1]$ cd holland.lib.common/
[vagrant@node1 holland.lib.common]$ sudo python setup.py install
running install
...
Adding holland.lib.common 1.0.8dev to easy-install.pth file
Installed /usr/lib/python2.6/site-packages/holland.lib.common-1.0.8dev-py2.6.egg
Processing dependencies for holland.lib.common==1.0.8dev
Finished processing dependencies for holland.lib.common==1.0.8dev
[vagrant@node1 holland.lib.common]$ cd ../holland.lib.mysql/
[vagrant@node1 holland.lib.mysql]$ sudo python setup.py install
running install
...
Adding holland.lib.mysql 1.0.8dev to easy-install.pth file
Installed /usr/lib/python2.6/site-packages/holland.lib.mysql-1.0.8dev-py2.6.egg
Processing dependencies for holland.lib.mysql==1.0.8dev
Finished processing dependencies for holland.lib.mysql==1.0.8dev
Now, I'm mainly interested in mysqldump and xtrabackup but you might want to use the mysql_lvm. I don't think there are many takers for mysqlhotcopy these days. The same steps apply for each provider you want to install on each machine.
[vagrant@node1 holland.backup.mysqldump]$ sudo python setup.py install running install ... Adding holland.backup.mysqldump 1.0.8dev to easy-install.pth file Installed /usr/lib/python2.6/site-packages/holland.backup.mysqldump-1.0.8dev-py2.6.egg Processing dependencies for holland.backup.mysqldump==1.0.8dev Finished processing dependencies for holland.backup.mysqldump==1.0.8dev
and then finally from the xtrabackup directory;
[vagrant@node1 plugins]$ cd holland.backup.xtrabackup/ [vagrant@node1 holland.backup.xtrabackup]$ sudo python setup.py install running install ... Adding holland.backup.xtrabackup 1.0.8dev to easy-install.pth file Installed /usr/lib/python2.6/site-packages/holland.backup.xtrabackup-1.0.8dev-py2.6.egg Processing dependencies for holland.backup.xtrabackup==1.0.8dev Finished processing dependencies for holland.backup.xtrabackup==1.0.8dev
So in summary it's the library files for the plugins;
- holland.lib.common
- holland.lib.mysql
- holland.lib.lvm (depending if you're going to use it)
In part two I'll be giving an overview of the config files and then part three will be some cookbook-like config for the various providers.
PlanetMySQL Voting: Vote UP / Vote DOWN
Can uninstall or repair mysql connector - HELP (1 reply)
I installed MySQL connector on a windows server and was advised to reinstall an earlier version.
So I tried to uninstall it, but could not, it remove all the components. It keeps saying MySQL has encountered a fatal error and rollsback. However the program still remains and I can reinstall or use it.
I haven't used MySQL much as I have used Microsoft applications.
In the bid to remove it, I noticed I have 3 services under the services app, and only one is running the others cant be started
We are trying to install joomla on windows, hence reason for MySQL on the server.
Please advise
see attachment
many thanks
Ehi
Percona Server for MySQL 5.5.31-30.3 now available
Percona Server for MySQL version 5.5.31-30.3
Percona is glad to announce the release of Percona Server for MySQL 5.5.31-30.3 on May 24, 2013 (Downloads are available here and from the Percona Software Repositories). Based on MySQL 5.5.31, including all the bug fixes in it, Percona Server 5.5.31-30.3 is now the current stable release in the 5.5 series. All of Percona‘s software is open-source and free, all the details of the release can be found in the 5.5.31-30.3 milestone at Launchpad.
New Features:
- Percona Server has ported the Atomic write support for Fusion-io devices patch from MariaDB. This feature adds atomic write support for directFS filesystem on Fusion-io devices. This feature implementation is considered BETA quality.
- Percona Server has introduced innodb_read_views_memory and innodb_descriptors_memory status variables in the Extended Show Engine InnoDB Status to improve InnoDB memory usage diagnostics.
Bugs Fixed:
- Fix for bug #1131187 introduced a regression that could cause a memory leak if query cache was used together with InnoDB. Bug fixed #1170103.
- Fixed the RPM packaging regression that was introduced with the fix for bug #710799. This regression caused mysql schema to be missing after the clean RPM installation. Bug fixed #1174426.
- Fixed the Percona-Server-shared-55 and Percona-XtraDB-Cluster-shared RPM package dependences. Bug fixed #1050654.
- Fixed the upstream bug #68999 which caused compiling Percona Server to fail on CentOS 5 and Debian squeeze due to older OpenSSL version. Bug fixed #1183610.
- If a slave was running with its binary log enabled and then restarted with the binary log disabled, Crash-Resistant Replication could overwrite the relay log info log with an incorrect position. Bug fixed #1092593.
- Fixed the CVE-2012-5615 vulnerability. This vulnerability would allow remote attacker to detect what user accounts exist on the server. This bug fix comes originally from MariaDB (see MDEV-3909). Bug fixed #1171941.
- Fixed the CVE-2012-5627 vulnerability, where an unprivileged MySQL account owner could perform brute-force password guessing attack on other accounts efficiently. This bug fix comes originally from MariaDB (see MDEV-3915). Bug fixed #1172090.
- mysql_set_permission was failing on Debian due to missing libdbd-mysql-perl package. Fixed by adding the package dependency. Bug fixed #1003776.
- Rebuilding Debian source package would fail because dpatch and automake were missing from build-dep. Bug fixed #1023575 (Stephan Adig).
- Backported the fix for the upstream bug #65077 from the MySQL 5.6 version, which removed MyISAM internal temporary table mutex contention. Bug fixed #1179978.
Release notes for Percona Server for MySQL 5.5.31-30.3 are available in our online documentation. Bugs can be reported on the launchpad bug tracker.
The post Percona Server for MySQL 5.5.31-30.3 now available appeared first on MySQL Performance Blog.
PlanetMySQL Voting: Vote UP / Vote DOWN
Unable to connect to foreign data source (1 reply)
I am trying to set up a FEDERATED table between two MySQL servers. I have created a separate user for this and enabled remote connection to the host server.
On the client server (meaning on the one where I create the FEDERATED table that connects to a table on the host server) I have enabled the FEDERATED enginge.
From the client server I can connect to the host database if I run mysql -h myhost -u myuser -p. I can select from all tables without issue.
Now the problem is that I can not access the data via the FEDERATED table. I can create it without problem and I get no error message. However, when I try SELECT * from myfederatedtable; then I get:
ERROR 1429 (HY000): Unable to connect to foreign data source: Can't connect to MySQL server on '196.168.2.224' (110)
What can be the reason for this?
Best regards
Jacek
Purge data from read replica (2 replies)
Would appreciate any pointer on this. Is there some other mechanism to achieve this requirement?
Tungsten University: Load a Vertica data warehouse with MySQL data
PlanetMySQL Voting: Vote UP / Vote DOWN
SQL with multiple join conditions... (3 replies)
I have a problem getting a query to work.
I have two tables like this:
#pricing#
ID - parent - material - lam - price
1 - 22 - test - 1 - 10
2 - 22 - test - 0 - 8
#pricing_ug#
ID - material - lam - ugprice
1 - test - 1 - 9
1 - test - 0 - 7
My query looks like this:
SELECT `pricing`.*, `pricing_ug`.`ugprice`
FROM (`pricing`)
LEFT JOIN `pricing_ug` ON
`pricing_ug`.`material` = `pricing`.`material`
AND `pricing_ug`.`lam` = `pricing`.`lam`
WHERE `pricing`.`parent` = '22'
The query works perfect with one of the conditions ( whether material = material or lam = lam ) but I need them both.
Can you give me any tips how to achive that?
Thanks a lot in advance!
