Side by side installations of MySQL - mysql

We're currently running MySQL 5.0.36sp1, and I'd like to evaluate whether we would get any kind of performance gain in running a more recent version. Can I safely install a newer version and run it on a different port without affecting my existing instance?
Ideally, I'd be able to turn on one instance at a time, and run the same tests on each instance.

You'd have to give it a different:
port
socket
pidfile
datadir
But that's about it.

Yes it is possible. Although deprecated by 5.1, this
http://dev.mysql.com/doc/refman/5.0/en/instance-manager.html
might be the easiest solution to what you are looking for.

Related

Can I use the same port on both MySQL Server and XAMPP?

Despites I've already installed XAMPP, I am trying to upload my database via MySQL server 5.7.17 since it's too big but both it and XAMPP use the same port - 3306. MySQL server is not even allowing me to continue to install it unless I make a change
SOrry, I'm a newbie.
Screenshots
Note It was suggested to me to download MySQL Server since I had already installed XAMPP but it didn't help me to upload my database.
No. If port 3306 is in use by an already installed and running MySQL instance, then another MySQL instance cannot use that same port. It is possible to run MySQL on a port other than the default 3306. But before we go there...
I think we might be barking up the wrong tree, trying to install another copy of MySQL and to run two instances of MySQL. Maybe we are wanting to run a different version of MySQL, other than the version other than what is included in the package we already installed.
But back pedal a bit here.
How is it that we reached the conclusion that installing another copy/version of MySQL was a viable solution to the problem we encountered?
It seems like we want to figure out the root cause of the original problem, before we chase down the wrong rabbit trail...

MySQL Server start permission denied

I am a a newbie to database programming and I want to try out MySQL.
I just installed MySQL from the official website, I am running mac 10.8.2.
Anyways, whenever I try to run a simple command like $>mysql.server start
it says Permission denied.
I am able to open it through sudo but I would love to get this fixed as this is annoying me, that it wont work properly. I have been searching for the last two hours without finding a fix, so I was hoping anyone could give me a helping hand.
The easiest way is to install the MySQL Startup Item. Then you get a Preference pane for MySQL.
See http://dev.mysql.com/doc/refman/5.5/en/macosx-installation-startupitem.html for full instructions.
Re your comment:
It's often required for services like mysql.server need to run as a uid other than your user login. For instance, the MySQL data directory may only be writeable by the mysql uid. So starting such a service must be done from a user that can change the uid of the process. The root uid can do that, so it's necessary to use sudo to launch service processes like mysql.server.
TL;DR: YOU HAVE TO USE SUDO.
If you a absolute newbie to MYSQL and you just want to use the MYSQL server to test your code on you local MAC I would advice you to take a look at XAMPP / MAMP. Xampp offers a complete out of the box install for everything you need for a development servers (Apache server, MySQL, PHP, etc). Note, that I XAMPP / MAMP is not suitable for production server setting.
I personally use the XAMPP Windows version. I haven't tried MAMP but I have come across it many times . The XAMPP for Mac version seem not to have been update for a while so I suggest you give MAMP a try.
You could of course try to get your current install to work but that might require some work. Also with regard to firewall / security issues. With the out of the box version you will have to do a lot less. Why reinvent the wheel if you can easily install a out of the box version.

mysql: keeping local mysql database and remote server database synced up

I am kind of a amateur at web development. But it seems like most people develop on their local machines and the upload to their remote servers when everything is ready. I want to start doing this. I've installed Xampp (Apache) on my local machine. But in order for this to really work, i need the the mysql databases that already exist on my remote server to be "synched" or "duplicated" on my local machine. But I'm finding this somewhat hard to figure out.
First, Should I be using mysql "reduplication" feature (with my remote server as master) and local machine as slave? Or is there a better way to do this? Should I be synchronizing instead of reduplicating
Second, Is anyone willing to give me a quick description of how I achieve this "reduplication" or "synchronization"
Thanks
It may be tempting, but it's hopeless to try to keep the database in two places. Instead, always keep the database on the server because it's much easier to develop and debug your code if it's in just one place. "Resynch" and "reduplicate" and all that business is just too much trouble, as you are discovering. The DB is going to end up on the server anyway, so you may as well put it there right now.
Also, you will not need a web server on your local machine, which will unburden you.
This next is applicable if you are writing CGI. If you aren't sure whether or not you are writing CGI, then you are not (well, probably not). {
If you mainain just one database and it lives on your server, you'll be able to write one piece of portable code that will run equally well on your local machine and on your server. This is a huge win, take my word for it.
To get this working, you will need the mysql library on your local machine; no other mysql component is needed there. The mysql server will run on your server only.
Read up on mysql "connector" for the language you're using.
}

UDF function with library dependencies on MySQL 5.1

I'm having a problem with a MySQL UDF function (mychem.sourceforge.net) that's dependent on a large library (openbabel.org) which is in turn plugin based. The problem is that the format plugins to openbabel doesn't seem to load in MySQL 5.1 and I suspect it might be due to the plugin_dir setting. I have set plugin_dir to /usr/lib/ which is the location for both libmychem.so and libopenbabel.so as well as the directory openbabel that contains the format plugins. Is there a way to turn off the plugin_dir restriction in MySQL (preferably without compiling MySQL from sources) so that I can test this hypothesis or do you have a different idea on what might cause the problem?
All this is done on Ubuntu 10.04 (but I had the same kind of problems on 8.04, where I managed to get it working after a lot of steps that I unfortunately have forgotten...)
I have turned off apparmor during testing and it doesn't help either.
I kind of solved my problem, so here is kind of an answer to my question. It all boils down to problems with apparmour, at least for me. The problem was that I couldn't turn off the apparmor, doing so seems to leave MySQL in full-enforce mode or something. If I had apparmor in complain mode, it worked fine, and I could also modify the apparmor profile so to not complain about the specific directories (i.e. the OpenBabel shared directory).
/Fredrik

Multiple MySQL versions

We have a Linux server running Red Hat Enterprise 3 and MySQL 3.23. This server has a number of websites on it.
We have a new website that we want to put on this server that uses MySQL 4/5. Is it possible to run the two versions of MySQL in parallel?
If so, how?
Yes you can. Of course on of the servers would have to use non-standard port number.
See the documentation http://dev.mysql.com/doc/refman/5.1/en/multiple-unix-servers.html
Yes, it's possible, but tricky.
Firstly, it's probably best not to use the RedHat supplied RPMS - they'll cause all sorts of dependency issues.
In essence, all you need to do is to build the two versions, and install them into completely different directories.
Then you need to make sure that they're configured with separate:
data directories
TCP ports
Local connection sockets
PID state files
In practise that can be done my creating two my.cnf files, and making sure those are chosen in the command line parameters in the daemon start up scripts.
Note also that you'll need to be very careful with any shared libraries that might get built, particularly if you're running any client applications on the same server.
This gets nasty if, for example, you want Perl::DBD::mysql running, as it's not simple to arrange for there to be two copies, with each linked against a different version of the shared libraries.