RE: mysqld_multi
I DON'T RUN SYSTEMD, so that's not an option. At all. Why is that so hard to grasp? Where do I enter the command "create table database" when mysqld isn't running? It isn't possible to launch mysqld when there's no database directory or initialized database. You fail to grasp my problem and your answers are completely unhelpful. I did not ask for "help" commands or links to the 5200-page reference manual, as those did not supply the options required to solve MY PROBLEM. This is a community forum where members are free to post questions. Several people pointed me toward the right direction but their answers were incomplete. It was ultimately Oracle support that answered my question, for which I am most appreciative. > they don't behave anything different if you have a single server Really? With mysqld_multi, each mysqld daemon listens on a separate port. Each database instance gets its own environment that database administrators control WITHOUT INTERFERING with other database instances. In single-server environment, the server listens only on port 3306 and all databases run on that one port; it is not possible to shutdown individual databases, only ALL databases. matthew -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Wednesday, May 31, 2017 9:28 AM To: mysql@lists.mysql.com Subject: Re: mysqld_multi Am 31.05.2017 um 17:48 schrieb Matthew Black: > # mysql -uroot -p --socket=/MySQLdb/cba/mysql.sock > mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; > mysql> quit > > I was simply seeking those three commands, but the reference manual did not > provide a real-world example. they don't behave anything different if you have a single server, mysqld_multi or just a dozen mysqld instances started directly with systemd and "Can anyone provide a simple example of how to edit /etc/my.cnf file and command line steps necessary for creating a new database running on, for example, port 3311" still is nosense besides a basic command like "create table database" where your problem was obviosuly connect to the instance at all in my first response you got: [harry@srv-rhsoft:~]$ mysql --help | grep port well, find the socket option is similar [harry@rh:~]$ mysql --help | grep socket -S, --socket=name The socket file to use for connection. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
RE: mysqld_multi
Thank you all for the tips. I've read the manual multiple times and it is NOT clear what options are necessary in a multi environment. The missing element was provided by Oracle support: I need to use --defaults-file=my.cnf as in: # mysqld --defaults-file=cba.cnf --initialize --user=cba CBA.CNF contents: [mysqld]# No instance number, NOT documented! socket = /MySQLdb/cba/mysql.sock port = 3317 pid-file = /MySQLdb/cba/mysqld.pid datadir= /MySQLdb/cba lc-messages-dir = /usr/share/mysql/English log-error = /MySQLdb/cba/mysql.error user = cba # mysql -uroot -p --socket=/MySQLdb/cba/mysql.sock mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; mysql> quit I was simply seeking those three commands, but the reference manual did not provide a real-world example. matthew -Original Message- From: shawn l.green [mailto:shawn.l.gr...@oracle.com] Sent: Saturday, May 20, 2017 10:57 AM To: mysql@lists.mysql.com Subject: Re: mysqld_multi Hello Matthew, On 5/19/2017 12:19 PM, Matthew Black wrote: > I just installed MySQL Enterprise Edition 5.7 on RHEL 6.8 to replace an aging > 5.1 system running on RHEL 5. We run mysqld_multi with multiple instances, > each database on its own TCP Port 33xx. I'm having trouble creating a > database on the new server in a multi environment. > > > > Can anyone provide a simple example of how to edit /etc/my.cnf file and > command line steps necessary for creating a new database running on, for > example, port 3311? > > > > Thanks in advance. > > > > matthew > How to use mysql_multi is covered in the Manual. This includes a sample my.cnf file demonstrating how to define your separate instances. https://dev.mysql.com/doc/refman/5.7/en/mysqld-multi.html However, before you setup an instance to be managed by mysqld_multi, you will need to instantiate a set of datafiles for that 5.7 instance of the mysqld daemon to manage. You do that following the directions here (by hand) the first time. https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html This means you need to setup at least two folders (one for --datadir and one for --tmpdir) for each separate instance you want to create and assign ownership and privileges to those folders appropriate to the user your mysqld daemon will be executing as when it runs. There are other things you must also keep unique between instances when they share a common host machine. Those are described here: https://dev.mysql.com/doc/refman/5.7/en/multiple-servers.html An example of setting up the folders and assigning privileges to them is located in the instructions to installing a set of mysqld binaries using a .zip or .tar archive. Please note, you do not need a separate mysqld installation for each instance you want to create. Several daemons (each operating on their own port, socket, folders, data files,... ) can be started using just one set of binary files. https://dev.mysql.com/doc/refman/5.7/en/binary-installation.html So... the general process would look like this (presuming you have already installed mysqld and setup at least one instance) == 1) Decide where you want a second (or later) instance to store its files. Choose port numbers and unix socket names for this new instance that are unique from any other instances that will be running on this host. 2) Setup any new folders you need to create (including assigning privileges) 3) Document those names and any other settings you want this additional instance to use in a configuration file specific for this instance 4) Use that special configuration file to bootstrap (initialize) the data files used to manage that instance (the --initialize instructions were linked to earlier in this reply) 5) Once you have this instance setup the way you want. Shut it down. 6) Copy the elements that are unique to this instance into an appropriately-named section of your common configuration file (the one that mysqld_multi will read) 7) Test that you can start/stop this new instance using mysqld_multi As you can tell, it takes a bit of planning and effort to establish a non-default setup of hosting multiple MySQL instances on the same host machine. There is no simple one-line command to tell mysqld_multi to create a new instance as there are things it cannot do (like create folders in your file system). Regards, -- Shawn Green MySQL Senior Principal Technical Support Engineer Oracle USA, Inc. - Integrated Cloud Applications & Platform Services Office: Blountville, TN Become certified in MySQL! Visit https://www.mysql.com/certification/ for details. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
RE: mysqld_multi
Sorry, but that is not the least bit helpful. We are not ready for RHEL 7, which is VERY different than prior versions. I don't really need the victim blaming for using an earlier RHEL release that is still fully supported and in widespread use. As for /etc/my.cnf, that's where one defines the port, database location, log file, port number, and user, so they don't have to be placed on the command line. Your response does not explain the command line steps necessary for creating a new database. matthew -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Friday, May 19, 2017 9:27 AM To: mysql@lists.mysql.com Subject: Re: mysqld_multi Am 19.05.2017 um 18:19 schrieb Matthew Black: > I just installed MySQL Enterprise Edition 5.7 on RHEL 6.8 to replace an aging > 5.1 system running on RHEL 5. We run mysqld_multi with multiple instances, > each database on its own TCP Port 33xx. I'm having trouble creating a > database on the new server in a multi environment. > > Can anyone provide a simple example of how to edit /etc/my.cnf file and > command line steps necessary for creating a new database running on, for > example, port 3311? what has this to do with the my.cnf? just connect to the correct instance and that's it and probably get rid of RHEL6 because with systemd you don't need all the crap around to start multiple instances, just a few lines in the unit-file pointing to the correct config and mysqld_safe is also no needed [harry@srv-rhsoft:~]$ mysql --help | grep port -P, --port=#Port number to use for connection or 0 for default to, in --progress-reports Get progress reports for long running commands (like (Defaults to on; use --skip-progress-reports to disable.) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
mysqld_multi
I just installed MySQL Enterprise Edition 5.7 on RHEL 6.8 to replace an aging 5.1 system running on RHEL 5. We run mysqld_multi with multiple instances, each database on its own TCP Port 33xx. I'm having trouble creating a database on the new server in a multi environment. Can anyone provide a simple example of how to edit /etc/my.cnf file and command line steps necessary for creating a new database running on, for example, port 3311? Thanks in advance. matthew